Skip to content
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

[vm/ffi] No error in CFE if generative constructor of Union subtype is called #46813

Closed
sgrekhov opened this issue Aug 5, 2021 · 0 comments
Closed
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. library-ffi

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Aug 5, 2021

The following tests fails in CFE

import "dart:ffi";

class U1 extends Union {
  @Int8()
  external int i;

  U1(this.i);
//        ^
// [analyzer] unspecified
// [cfe] unspecified
}

void main() {
  new U1(42);   // No error in CFE here. Analyzer reports an error here
//    ^^
// [analyzer] unspecified
// [cfe] unspecified
}

Instances of Union cannot be created via generative constructor, so new U1(42); must be an error in CFE as well

Tested on the edge version of the SDK

@sgrekhov sgrekhov added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi labels Aug 5, 2021
@a-siva a-siva added area-front-end Use area-front-end for front end / CFE / kernel format related issues. and removed area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. library-ffi
Projects
None yet
Development

No branches or pull requests

3 participants