We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 96a3c11 + 3ee5b29 commit 05b102aCopy full SHA for 05b102a
compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -778,6 +778,8 @@ object Checking {
778
}
779
clParamAccessors match {
780
case param :: params =>
781
+ if (defn.isContextFunctionType(param.info))
782
+ report.error("value classes are not allowed for context function types", param.srcPos)
783
if (param.is(Mutable))
784
report.error(ValueClassParameterMayNotBeAVar(clazz, param), param.srcPos)
785
if (param.info.isInstanceOf[ExprType])
tests/neg/i22752.scala
@@ -0,0 +1,4 @@
1
+class Inner(body: Int ?=> Int) extends AnyVal: // error
2
+ def rescue: Int ?=> Int = ???
3
+
4
+class Inner2(body: Int => Int) extends AnyVal // ok
0 commit comments