From 8592af1c815c34078d89c08536addbe757550179 Mon Sep 17 00:00:00 2001 From: liu fengyun Date: Mon, 7 Nov 2016 23:10:01 +0100 Subject: fix #1670: move the check of value class to typer --- compiler/src/dotty/tools/dotc/typer/RefChecks.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/typer/RefChecks.scala') diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index 46bdbf3b3..feeb80547 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -689,7 +689,7 @@ object RefChecks { } /** Verify classes extending AnyVal meet the requirements */ - private def checkDerivedValueClass(clazz: Symbol, stats: List[Tree])(implicit ctx: Context) = { + def checkDerivedValueClass(clazz: Symbol, stats: List[Tree])(implicit ctx: Context) = { def checkValueClassMember(stat: Tree) = stat match { case _: ValDef if !stat.symbol.is(ParamAccessor) => ctx.error(s"value class may not define non-parameter field", stat.pos) @@ -836,7 +836,6 @@ class RefChecks extends MiniPhase { thisTransformer => checkParents(cls) checkCompanionNameClashes(cls) checkAllOverrides(cls) - checkDerivedValueClass(cls, tree.body) tree } catch { case ex: MergeError => -- cgit v1.2.3