Skip to content

vm/dart/redirection_type_shuffling_test is failing #29201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kmillikin opened this issue Mar 30, 2017 · 2 comments
Closed

vm/dart/redirection_type_shuffling_test is failing #29201

kmillikin opened this issue Mar 30, 2017 · 2 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. front-end-fasta legacy-area-front-end Legacy: Use area-dart-model instead. P2 A bug or feature request we're likely to work on

Comments

@kmillikin
Copy link

kmillikin commented Mar 30, 2017

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.

@kmillikin kmillikin added front-end-fasta area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Mar 30, 2017
@kmillikin
Copy link
Author

The tests

vm/dart/redirection_type_shuffling_test/00
lib/mirrors/constructor_optional_args_test

are failing due to the same issue.

@peter-ahe-google
Copy link
Contributor

This is because we don't have kernel node to represent a redirecting factory. See #29169.

@sigmundch sigmundch added the legacy-area-front-end Legacy: Use area-dart-model instead. label Oct 4, 2017
@jensjoha jensjoha added the P2 A bug or feature request we're likely to work on label Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. front-end-fasta legacy-area-front-end Legacy: Use area-dart-model instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants