File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1106,7 +1106,7 @@ class Namer { typer: Typer =>
11061106 mdef match {
11071107 case mdef : DefDef if mdef.name == nme.ANON_FUN =>
11081108 val hygienicType = avoid(rhsType, paramss.flatten)
1109- if (! (hygienicType <:< tpt.tpe))
1109+ if (! hygienicType.isValueType || ! (hygienicType <:< tpt.tpe))
11101110 ctx.error(i " return type ${tpt.tpe} of lambda cannot be made hygienic; \n " +
11111111 i " it is not a supertype of the hygienic type $hygienicType" , mdef.pos)
11121112 // println(i"lifting $rhsType over $paramss -> $hygienicType = ${tpt.tpe}")
Original file line number Diff line number Diff line change 1+ object Foo {
2+ def f ()()(implicit ctx : String ): Int = ???
3+ def at [T ](op : () => T ): Unit = ()
4+ at(() => f()) // error: missing ()
5+ }
You can’t perform that action at this time.
0 commit comments