-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
42 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters