Navigation Menu

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: Incorrect error message if trying to use factory constructor as super constructor. #11202

Closed
lrhn opened this issue Jun 11, 2013 · 1 comment
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug

Comments

@lrhn
Copy link
Member

lrhn commented Jun 11, 2013

Example code:
  class wExtendedElementList extends List {
    wExtendedElementList.from(List elements) : super.from(elements){}
  }
This uses a factory constructor as the super-constructor in the initializer list. The error message given is:

  Error: line 2 pos 48: super class constructor 'List.from' not found
      wExtendedElementList.from(List elements) : super.from(elements){}

This error message is misleading, going on incorrect, since List.from is a constructor. The error isn't that it doesn't exist, but that it is a factory constructor instead of a generative constructor.
(It's technically true that the compiler didn't find List.from, but that's because it was looking in the wrong place).

@lrhn lrhn added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. labels Jun 11, 2013
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@zanderso zanderso added type-enhancement A request for a change that isn't a bug and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jan 5, 2017
@zanderso
Copy link
Member

zanderso commented Jan 5, 2017

This appears to be still happening.

mhausner added a commit that referenced this issue Feb 6, 2017
Instead of “unresolved call to super constructor”, adapt error
message if the super class contains a factory constructor with
the same name.

Also add this error message clarification to constructor redirection
clauses.

BUG=#11202
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2673423003 .
@mhausner mhausner closed this as completed Feb 7, 2017
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, FFI, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants