-
Notifications
You must be signed in to change notification settings - Fork 26
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
Corrected regression of #203 #205
Conversation
Why is |
|
Sorry, forgot the not there. Updated. |
Is |
Yes, I feel so. |
This commit fixes the regression that made the following program (incorrectly) compile: ``` class Main def main() : void let app = \(f:a->b, g:b->c, x : a) -> let y = f(x) in g(x) in () ``` It also includes some changes suggested by @albertnetymk. == Message of the fixed commit == This commit fixes two bugs related to matching types: ``` passive class Foo<a> def foo(x : Bar<a>) : a x.bar() -- #1 Can't match 'b' with 'a' passive class Bar<b> f : b def init(f : b) : void this.f = f def bar() : b this.f class Main { def main() : void { let x = new Foo<int> y = new Bar<int>(42) in{ print x.foo(y) -- #2 Type 'Bar<int>' does not match expected type 'Bar<t>' } } } ``` The first bug prevented matching two type variables unless they had the same name. The second one prevented correctly matching against a parametric type whose parameter was itself the type parameter of the enclosing class.
Done and done! |
I also renamed some functions to avoid possible name confusion |
I think it could be merged, if there's no objections from others. |
Corrected regression of #203
This PR fixes the bug introduced by #203 (found by @albertnetymk). The following program now (correctly) does not compile: