Skip to content

Commit

Permalink
Merge d085492 into 4d306ff
Browse files Browse the repository at this point in the history
  • Loading branch information
chenglou committed Mar 15, 2018
2 parents 4d306ff + d085492 commit 0d4b64b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions jscomp/super_errors/super_typecore.ml
Expand Up @@ -228,8 +228,19 @@ let report_error env ppf = function
type_expr typ;
fprintf ppf "@ @[It only accepts %i %s; here, it's called with more.@]@]"
acceptsCount (if acceptsCount == 1 then "argument" else "arguments")
| Tconstr ((Path.Pdot (((Pdot (Path.Pident {name="Js"}, "Internal", _))| (Pident {name="Js_internal"})), ("fn" | "meth"), _)), _, _)
-> fprintf ppf "This is an uncurried bucklescript function. It must be applied with [@bs]."
| Tconstr (
(Path.Pdot (((Pdot (Path.Pident {name="Js"}, "Internal", _)) | (Pident {name="Js_internal"})), ("fn" | "meth"), _)),
_,
_
)
->
fprintf
ppf
"@[<v>This is an uncurried BuckleScript function. @{<info>It must be applied with a dot@}.@,@,\
Like this: @{<info>foo(. a, b)@}@,\
Not like this: @{<dim>foo(a, b)@}@,@,\
This guarantees that your function is fully applied. More info here:@,\
https://bucklescript.github.io/docs/en/function.html#solution-guaranteed-uncurrying@]"
| _ ->
fprintf ppf "@[<v>@[<2>This expression has type@ %a@]@ %s@]"
type_expr typ
Expand Down
2 changes: 2 additions & 0 deletions jscomp/super_errors/super_warnings.ml
Expand Up @@ -18,5 +18,7 @@ let message (warning : Warnings.t) =
"This file's name is potentially invalid. The build systems conventionally turn a file name into a module name by upper-casing the first letter. " ^ modname ^ " isn't a valid module name.\n" ^
"Note: some build systems might e.g. turn kebab-case into CamelCase module, which is why this isn't a hard error."
| Statement_type -> "This expression returns a value, but you're not doing anything with it. If this is on purpose, put `|> ignore` at the end."
| Useless_record_with ->
"All the fields are already explicitly listed in this record. You can remove the `...` spread."
| _ -> Warnings.message warning
;;

0 comments on commit 0d4b64b

Please sign in to comment.