Skip to content

[DDC] final field overriding an inherited getter reads as null when the class declares a same name setter. #63964

Description

@Diaga

Reproducible on dartpad stable (Based on Dart SDK 3.12.2 and Flutter SDK 3.44.8) and main (Based on Dart SDK 3.14.0-10.0.dev and Flutter SDK 3.47.0-1.0.pre-43) channels:

abstract class Base {
  String get id;

  set id(String value);
}

class Broken extends Base {
  @override
  final String id;

  Broken(this.id);

  @override
  set id(String value) {
    throw UnsupportedError('immutable');
  }
}

void main() {
  print(Broken('A').id); // VM: A — dart2js: A — DDC: null
}

Related: #29914 and #46867

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)web-dev-compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions