Skip to content

vm/dart/redirection_type_shuffling_test is failing #29201

Closed
@kmillikin

Description

@kmillikin

cc: @peter-ahe-google @mraleph

tools/test.py -cdartk vm/dart/redirection_type_shuffling_test/none

The Dart source of the test is pretty simple. It has a redirecting factory constructor (with type arguments) and it uses mirrors:

class G<A extends int, B extends String> {
  G();
  factory G.retain() = G<A,B>;
}

main() {
  ClassMirror cm = reflect(new G<int, String>()).type;
  Expect.isTrue(cm.newInstance(#retain, []).reflectee is G<int,String>);
}

There are at least two problems here. (1) Fasta is generating an invalid expression in the body of the redirecting constructor:

class G<A extends core::int, B extends core::String> extends core::Object {
  static field dynamic _redirecting# = <dynamic>[self::G::retain];
  constructor •() → void
    : super core::Object::•()
    ;
  static factory retain<A extends core::int, B extends core::String>() → dynamic
    let final dynamic #t1 = self::G::• in invalid-expression;
}
static method main() → dynamic {
  mir::ClassMirror cm = mir::reflect(new self::G::•<core::int, core::String>()).type;
  exp::Expect::isTrue(cm.newInstance(#retain, <dynamic>[]).reflectee is self::G<core::int, core::String>);
}

and (2) the VM's Kernel->flow graph translator is not prepared to handle the tearoff of the constructor self::G::•. It assumes that this can't occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.front-end-fastalegacy-area-front-endLegacy: Use area-dart-model instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions