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 1cfea91 commit 10a3a08Copy full SHA for 10a3a08
compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -341,7 +341,7 @@ object Checking {
341
if (!ok && !sym.is(Synthetic))
342
fail(i"modifier `$flag` is not allowed for this definition")
343
344
- if (sym.is(Inline) && sym.is(ParamAccessor) && sym.owner.isClass)
+ if (sym.is(Inline) && ((sym.is(ParamAccessor) && sym.owner.isClass) || sym.is(TermParam) && sym.owner.isClassConstructor))
345
fail(ParamsNoInline(sym.owner))
346
347
if (sym.is(ImplicitCommon)) {
tests/neg/i3900.scala
@@ -2,3 +2,6 @@ class Foo(inline val i: Int) // error
2
case class Foo2(inline val i: Int) // error
3
class Foo3(inline val i: Int) extends AnyVal // error
4
trait Foo4(inline val i: Int) // error
5
+class Foo5() {
6
+ def this(inline x: Int) = this() // error
7
+}
0 commit comments