diff options
author | liu fengyun <liufengyunchina@gmail.com> | 2016-11-07 23:10:01 +0100 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2016-11-24 13:36:04 +0100 |
commit | 8592af1c815c34078d89c08536addbe757550179 (patch) | |
tree | babe705efa6062e35e64d78302735fd9511df9b2 /compiler/src/dotty/tools/dotc/typer/RefChecks.scala | |
parent | 3599c243c86ae0a926ef45a435d38b7878dc322f (diff) | |
download | dotty-8592af1c815c34078d89c08536addbe757550179.tar.gz dotty-8592af1c815c34078d89c08536addbe757550179.tar.bz2 dotty-8592af1c815c34078d89c08536addbe757550179.zip |
fix #1670: move the check of value class to typer
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/RefChecks.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/RefChecks.scala | 3 |
1 files changed, 1 insertions, 2 deletions
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 => |