Skip to content

Commit daaedb8

Browse files
committed
Error on value class with phantom value
1 parent 3ae3b08 commit daaedb8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ object Checking {
464464
case List(param) =>
465465
if (param.is(Mutable))
466466
ctx.error("value class parameter must not be a var", param.pos)
467+
if (param.info.isPhantom)
468+
ctx.error("value class parameter must not be phantom", param.pos)
467469
case _ =>
468470
ctx.error("value class needs to have exactly one val parameter", clazz.pos)
469471
}

0 commit comments

Comments
 (0)