File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -667,10 +667,14 @@ class LeastUpperBoundHelper {
667667 return _functionType (T1 , T2 );
668668 }
669669
670- // UP(T Function<...>(...), T2) = Object
671- // UP(T1, T Function<...>(...)) = Object
672- if (T1 is FunctionType || T2 is FunctionType ) {
673- return _typeSystem.objectNone;
670+ // UP(T Function<...>(...), T2) = UP(Object, T2)
671+ if (T1 is FunctionType ) {
672+ return getLeastUpperBound (_typeSystem.objectNone, T2 );
673+ }
674+
675+ // UP(T1, T Function<...>(...)) = UP(T1, Object)
676+ if (T2 is FunctionType ) {
677+ return getLeastUpperBound (T1 , _typeSystem.objectNone);
674678 }
675679
676680 // UP(T1, T2) = T2 if T1 <: T2
Original file line number Diff line number Diff line change @@ -2000,6 +2000,20 @@ class UpperBound_FunctionTypes_Test extends _BoundsTestBase {
20002000 );
20012001 }
20022002 }
2003+
2004+ test_unrelated () {
2005+ var T1 = functionTypeNone (returnType: intNone);
2006+
2007+ _checkLeastUpperBound (T1 , intNone, objectNone);
2008+ _checkLeastUpperBound (T1 , intQuestion, objectQuestion);
2009+ _checkLeastUpperBound (T1 , intStar, objectStar);
2010+
2011+ _checkLeastUpperBound (
2012+ T1 ,
2013+ futureOrNone (functionQuestion),
2014+ objectQuestion,
2015+ );
2016+ }
20032017}
20042018
20052019@reflectiveTest
You can’t perform that action at this time.
0 commit comments