Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic function overload error #50

Closed
jfecher opened this issue Aug 4, 2017 · 0 comments
Closed

Generic function overload error #50

jfecher opened this issue Aug 4, 2017 · 0 comments

Comments

@jfecher
Copy link
Owner

jfecher commented Aug 4, 2017

The following code snippet:

type Maybe<'t> =
   | Some 't
   | None

fun div: 't a b -> Maybe<'t>
    if b == 0 then None
    else Some(a/b)

div 2 4
div 5.0 0.0

(Incorrectly) issues the following error:

u.an: 10,1-3    error: No matching candidates for call to div with args (f64, f64)
...
u.an: 5,5-7     note: Candidate function with params (i32, i32)
...
u.an: 5,5-7     note: Candidate function with params (i32)

In which the second candidate should not exist

@jfecher jfecher closed this as completed in 15f4421 Aug 5, 2017
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

No branches or pull requests

1 participant