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 =>
1106
1106
mdef match {
1107
1107
case mdef : DefDef if mdef.name == nme.ANON_FUN =>
1108
1108
val hygienicType = avoid(rhsType, paramss.flatten)
1109
- if (! (hygienicType <:< tpt.tpe))
1109
+ if (! hygienicType.isValueType || ! (hygienicType <:< tpt.tpe))
1110
1110
ctx.error(i " return type ${tpt.tpe} of lambda cannot be made hygienic; \n " +
1111
1111
i " it is not a supertype of the hygienic type $hygienicType" , mdef.pos)
1112
1112
// 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