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
{{ message }}
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
testChecker(
'infer from RHS only if it wont conflict with overridden fields 2',
{
'/main.dart':''' class A { final x; } class B extends A { final x = 2; } foo() { String y = /*severe:StaticTypeError*/new B().x; int z = new B().x; } '''
},
inferFromOverrides:true);
Naturally non-final fields need to be invariant. But subtypes should be allowed to narrow final fields, right? The test above expects B.x to be inferred as int because that doesn't violate the contract of A.x