dart-lang / dart-lang/language
Unexpected type inference failure with self-referential types.
Open
request
type-inference
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
Consider the following example, where the type argument of `baz` in the second call to `baz` can't be inferred.
```dart
void bar() {
void baz>(B c) {}
baz(FooSelfImpl());
// v fails to infer FooSelf
baz(FooSelfImpl());
}
abstract class Foo {}
abstract class FooSelf implements Foo {}
class FooSelfImpl implements FooSelf {}
```
It would be nice if `FooSelf` could be inferred.
Contributor guide
Assessment
This issue has not been assessed yet.