You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For expression of the form (expression == null) and (null == expression), the CPA type inference infers null instead of bool for =='s selector.
Reason: SimpleTypeInferrerVisitor.visitDynamicSend never calls handleDynamicSend when one of the two arguments of == is the literal 'null'. Because of that, getSendReturnType is never called and I never call augmentInferredSelectorType.
Example where it leads to wrong output:
class A {
operator ==(x) => "a";
}
main() {
new A() == 1;
1 == null;
}
Inferred selector type for default inference is Union of [[exact=JSString], [exact=JSBool]]
Inferred selector type for CPA inference is [exact=JSString]
Intersection is [exact=JSString]
The text was updated successfully, but these errors were encountered:
For expression of the form (expression == null) and (null == expression), the CPA type inference infers null instead of bool for =='s selector.
Reason: SimpleTypeInferrerVisitor.visitDynamicSend never calls handleDynamicSend when one of the two arguments of == is the literal 'null'. Because of that, getSendReturnType is never called and I never call augmentInferredSelectorType.
Example where it leads to wrong output:
class A {
operator ==(x) => "a";
}
main() {
new A() == 1;
1 == null;
}
Inferred selector type for default inference is Union of [[exact=JSString], [exact=JSBool]]
Inferred selector type for CPA inference is [exact=JSString]
Intersection is [exact=JSString]
The text was updated successfully, but these errors were encountered: