VM: Incorrect error message if trying to use factory constructor as super constructor. #11202
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
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).
The text was updated successfully, but these errors were encountered: