Skip to content

NNBD: Default type bound of the generic type parameter is incorrect in runtime: it's dynamic instead of Object? #40367

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

Closed
iarkh opened this issue Jan 29, 2020 · 2 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. NNBD Issues related to NNBD Release

Comments

@iarkh
Copy link
Contributor

iarkh commented Jan 29, 2020

Dart VM version: 2.8.0-edge.40f23c735f04433e4fc334fbd674474bd3de0f8b (Tue Jan 28 01:14:48 2020 +0000) on "linux_x64"

NNBD Spec reads:

The default bound of generic type parameters is treated as Object?.
However, currently this is not so.
Please run the following code:

class A<T> {}
main() {
  print(A);
}

It prints A<dynamic> whereas it should be A<Object?>:

iarkh@med:~/dart/dart-sdk/sdk/tests/co191/src/LanguageFeatures/nnbd$ dart --enable-experiment=non-nullable test.dart
A

@iarkh iarkh changed the title NNBD: Default type bound of the generic type parameter is incorrect: it's dynamic instead of Object? NNBD: Default type bound of the generic type parameter is incorrect in runtime: it's dynamic instead of Object? Jan 29, 2020
@a-siva a-siva added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. NNBD Issues related to NNBD Release labels Jan 29, 2020
@eernstg
Copy link
Member

eernstg commented Jan 31, 2020

I2b should actually still compute the value dynamic for such type arguments, cf. #40368 (comment).

@crelier
Copy link
Contributor

crelier commented Feb 25, 2020

Closing as working as intended.

@crelier crelier closed this as completed Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. NNBD Issues related to NNBD Release
Projects
None yet
Development

No branches or pull requests

4 participants