Skip to content

DDC not initialing mixin fields properly from named constructor #29544

Closed
@vsmenon

Description

@vsmenon

This was hit internally. This is the simplified repro:

import 'package:test/test.dart';

abstract class A {
  bool _done = true;
}

abstract class B {
  String name;

  B.protected();
}

class C extends B with A {
  C(): super.protected() {
    name = 'C';
  }
}

void main() {
  test('mixin works', () {
    C c = new C();
    expect(c._done, true); // DDC test fails because [c._done] reads [null]
  });
}

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresweb-dev-compiler

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions