This repository was archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
task model: Classes with call methods don't type check #356
Comments
16 tasks
I can take a look |
Looks like we used to handle this in rules.dart, getCallMethodType, which is used in various places for type checking |
Strangely, that logic looks to have been ported to resolver.dart, StrongTypeSystemImpl. In fact almost this exact test case exists: void test_isSubtypeOf_call_method() {
ClassElementImpl classBottom = ElementFactory.classElement2("Bottom");
MethodElement methodBottom =
ElementFactory.methodElement("call", objectType, <DartType>[intType]);
classBottom.methods = <MethodElement>[methodBottom];
DartType top = TypeBuilder.functionType(<DartType>[intType], objectType);
InterfaceType bottom = classBottom.type;
_checkIsStrictSubtypeOf(bottom, top);
}
void test_isAssignableTo_call_method() {
ClassElementImpl classBottom = ElementFactory.classElement2("B");
MethodElement methodBottom =
ElementFactory.methodElement("call", objectType, <DartType>[intType]);
classBottom.methods = <MethodElement>[methodBottom];
DartType top = TypeBuilder.functionType(<DartType>[intType], objectType);
InterfaceType bottom = classBottom.type;
_checkIsAssignableTo(top, bottom);
} |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the task model branch, I'm getting an error on the assignment in main below:
Error is:
No errors or warnings in bleeding_edge.
The text was updated successfully, but these errors were encountered: