-
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
Infinite loop in expanding abstract class with self type #209
Comments
Minimized: abstract class Foo[T]: Foo[Int]
(f: Foo['a]) => f : Str Minimized further (but the trace looks different): abstract class Foo: Foo
(f: Foo) => f : Str |
Another one: type Foo = Foo & Int
(f: Foo) => f : Str We have to be more careful when we expand types during normalization... |
Note that this only happens on the "new parser/typer frontend" (#187). In the legacy frontend, we were careful to check for cycles in definitions and yielded "Error in class definitions: illegal cycle involving type Foo" for the latter example. We have to adapt these sorts of checks to the new frontend. |
Of course, we can also get unsoundness from such ill-formed types: type A = A
//│ type A = A
(1 : A)()
//│ nothing
//│ res
//│ Runtime error:
//│ TypeError: 1 is not a function |
The following code causes an infinite loop in type checking
Bar
, we haveBar => (#Bar<Object,Foo> & Bar)
Bar
, we haveBar => #Bar<Object,Foo>
The text was updated successfully, but these errors were encountered: