File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2002,11 +2002,13 @@ class Definitions {
20022002 * - the upper bound of a TypeParamRef in the current constraint
20032003 */
20042004 def asContextFunctionType (tp : Type )(using Context ): Type =
2005- tp.stripNull(). stripTypeVar.dealias match
2005+ tp.stripTypeVar.dealias match
20062006 case tp1 : TypeParamRef if ctx.typerState.constraint.contains(tp1) =>
20072007 asContextFunctionType(TypeComparer .bounds(tp1).hiBound)
20082008 case tp1 @ PolyFunctionOf (mt : MethodType ) if mt.isContextualMethod =>
20092009 tp1
2010+ case tp : FlexibleType =>
2011+ asContextFunctionType(tp.hi)
20102012 case tp1 =>
20112013 if tp1.typeSymbol.name.isContextFunction && isFunctionNType(tp1) then tp1
20122014 else NoType
Original file line number Diff line number Diff line change 1+ class Test :
2+ val x : ((a : String ) ?=> Int ) | Null = null
3+
4+ val x2 : ((a : String ) ?=> Int ) | Null = (s : String ) ?=> 42
5+
6+ val y : ((a : String ) ?=> Int ) | String = " hello"
7+
8+ def f (g : ((a : String ) ?=> Int ) | Null = null ) = ???
9+
You can’t perform that action at this time.
0 commit comments