Skip to content

Conversation

cristianoc
Copy link
Collaborator

The following repro:

/lib/bsc.exe -bs-super-errors -bs-eval 'let add = ((fun x  -> fun y  -> x + y)[@bs ]) let x = ((add 3)[@bs ])'

Now gives:

Found uncurried application [@bs] with arity 2, where arity 1 was expected.
This has type:
  (int -> int -> int [@bs]) (defined as (int -> int -> int [@bs]))
But somewhere wanted:
  ('a -> 'b [@bs]) (defined as ('a -> 'b [@bs]))
These two variant types have no intersection

The following repro:
```
/lib/bsc.exe -bs-super-errors -bs-eval 'let add = ((fun x  -> fun y  -> x + y)[@bs ]) let x = ((add 3)[@bs ])'
```
Now gives:
```
Found uncurried application [@bs] with arity 2, where arity 1 was expected.
This has type:
  (int -> int -> int [@bs]) (defined as (int -> int -> int [@bs]))
But somewhere wanted:
  ('a -> 'b [@bs]) (defined as ('a -> 'b [@bs]))
These two variant types have no intersection
```
Copy link
Member

@bobzhang bobzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great, except my minor comments, feel free to merge it once addressed

let arity t = match t.desc with
| Tvariant { row_fields = [(label,_)] } ->
let len = String.length label in
if len > 6 &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could the magic number 6 be less magic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants