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

Type synonyms cannot be recursive. #413

Closed
PhucVH888 opened this issue May 13, 2016 · 8 comments
Closed

Type synonyms cannot be recursive. #413

PhucVH888 opened this issue May 13, 2016 · 8 comments

Comments

@PhucVH888
Copy link
Contributor

When define a fake polymorphic function using typedef, with argument type is closure, then it raises an error.

typedef A = int

def foo(x:A,f:A->A) : A
  f(x)

class Main
  def main() : void {
    let f = \(x:A) -> x*100 in
    print foo(9,f)
  }

The error relates to alias name A of type int.

Type synonyms cannot be recursive. One of the culprits is A
In parameter 'f : A -> A'
In function 'foo' of type 'A'
@PhucVH888 PhucVH888 added the bug label May 13, 2016
@EliasC
Copy link
Contributor

EliasC commented May 13, 2016

This should be fixed by #408! Could you try checking it out and confirming?

@PhucVH888
Copy link
Contributor Author

I see. Is it ready to be merged?

@EliasC
Copy link
Contributor

EliasC commented May 13, 2016

Since it's my PR, it's not up to me to decide :)

@PhucVH888
Copy link
Contributor Author

Ok, I will test it and confirm with you 👍

@PhucVH888
Copy link
Contributor Author

@EliasC : Bravo, it works.

@EliasC
Copy link
Contributor

EliasC commented May 13, 2016

Great! I think @supercooldave was also reviewing that PR. If you are both happy with it it can be merged.

@supercooldave
Copy link

I find the whole "fake polymorphic function" part a bit of a red herring.

I will make a new test for this case, and then I can do the merge.

@supercooldave
Copy link

Closed by #408.

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

3 participants