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.
1 parent 9ebb8c4 commit 5c1e5f6Copy full SHA for 5c1e5f6
compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -755,6 +755,8 @@ object Checking {
755
}
756
clParamAccessors match {
757
case param :: params =>
758
+ if (defn.isContextFunctionType(param.info))
759
+ report.error("value classes are not allowed for context function types", param.srcPos)
760
if (param.is(Mutable))
761
report.error(ValueClassParameterMayNotBeAVar(clazz, param), param.srcPos)
762
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