Skip to content

Evaluations should work for runtimeType #59711

Open
@FMorschel

Description

@FMorschel

Say you have

class A {}

class B extends A {
  int foo() => 0;
}

class C {
  C(this.a);
  A a;
}

void main() {
  var c = C(B());  // Breakpoint here 
}

Now you try to evaluate c.a.foo() it gives you an error message about foo not being defined for A. But if you do (c.a as dynamic).foo() everything works normally and it can result in 0 here.

Could the evaluations do something like this internally?

// CC @DanTup

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.cfe-expression-compilationIssues related to expression compilation in the CFElegacy-area-front-endLegacy: Use area-dart-model instead.triagedIssue has been triaged by sub team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions