dart_eval icon indicating copy to clipboard operation
dart_eval copied to clipboard

Support for overriding class properties

Open Noobware1 opened this issue 7 months ago • 0 comments

test case

void main() {
  final compiler = Compiler();

  final packages = {
    'test': {
      'main.dart': '''
class TestClass  {
  TestClass(int someNumber) : super(someNumber);

  String get someString => this.notHello;

  String get notHello => 'notHello';

}

class TestClass1 extends TestClass {
  TestClass1(int someNumber) : super(someNumber);

  @override
  String get notHello => 'whyHello';
}

void main() {
print(TestClass1(5).someString);
}
'''
    }
  };

  final program = compiler.compile(packages);

  final runtime = Runtime.ofProgram(program);

  runtime.executeLib('package:test/main.dart', 'main', []);
}

output: "notHello" excepted output: "whyHello"

Noobware1 avatar Jul 21 '24 11:07 Noobware1