-
Notifications
You must be signed in to change notification settings - Fork 1.8k
vm/dart/redirection_type_shuffling_test is failing #29201
Copy link
Copy link
Closed
Labels
P2A bug or feature request we're likely to work onA 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.Use 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.Legacy: Use area-dart-model instead.
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA 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.Use 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.Legacy: Use area-dart-model instead.