Skip to content

[dart2wasm] Generics unexpected runtimeType when extends to nullable #55741

Description

@huanghui1998hhh
void main() {
  print(AlwaysNullableData('').runtimeType);
}

abstract class BaseData<T> {
  BaseData(this.data);

  T data;
}

class AlwaysNullableData<T> extends BaseData<T?> {
  AlwaysNullableData(super.data);
}

This code will print AlwaysNullableData<String> on other platform, but on dart2wasm it print AlwaysNullableData<String?>

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart2wasmIssues for the dart2wasm compiler.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions