native
native copied to clipboard
☂️ Support Wildcards (in generics)
- [x] dart-lang/native#705
- [ ] dart-lang/native#704
- [x] dart-lang/native#693
- [ ] dart-lang/native#713
Related Generics issues:
dart-lang/native#705 dart-lang/native#704 dart-lang/native#693 dart-lang/native#713
It might be better to map the JLS generics to Dart generics upfront for once, in form of a specification.
I face this problem when implementing parsing of wildcard in asm (TypeUsageSignatureVisitor)[^problem]. So I am looking for a way to solve this if possible.
What are our options here?
-
? extends QualifiedNamewill map toQualifiedNameand? super QualifiedNamewill map toObject. This is probably easiest to implement, and with current implementation ofTypeSignatureVisitorin summarizer, this is what happens anyway. -
? extends QualifiedNamewill create a new type variableW1 extends QualifiedName.? super QualifiedNameis stillObject.
I need to study the generics spec, especially the covariance part, but I would like to listen from those who already have. :)
[^problem]: Map<K, V> uses many ? extends K kind of stuff. Previously +K would get parsed as K but if we want to parse it as ? extends K, we should handle Kind.WILDCARD properly in the generator.