diff options
author | Martin Odersky <odersky@gmail.com> | 2014-04-03 17:55:20 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-04-08 17:02:29 +0200 |
commit | d079c0291289ad9f6517b0b929c4f03ef6b9f082 (patch) | |
tree | 0a6fdfd3b6d5409228716c84d32a7fb2df9c5ee1 /src/dotty/tools/dotc/typer/Namer.scala | |
parent | 09a4bc5d099de71de824a35a67a26e7091e3bb5a (diff) | |
download | dotty-d079c0291289ad9f6517b0b929c4f03ef6b9f082.tar.gz dotty-d079c0291289ad9f6517b0b929c4f03ef6b9f082.tar.bz2 dotty-d079c0291289ad9f6517b0b929c4f03ef6b9f082.zip |
Flag self names that conflict with parameters or members
A self name may no longer have the same name as a parameterless
class member (or param accessor). The restriction makes sense because
otherwise scoping is confusing. It's needed because otherwise we get
TermRefs that have the same name and prefix but denote different things.
Moved some code which exercises this from pos/typers to neg/typers
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 2425bea50..cce2f7318 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -209,7 +209,7 @@ class Namer { typer: Typer => ctx.error(s"${preExisting.showLocated} is compiled twice, runid = ${ctx.runId}", tree.pos) } else if ((!ctx.owner.isClass || name.isTypeName) && preExisting.exists) { - ctx.error(d"$name is already defined as $preExisting") + ctx.error(i"$name is already defined as $preExisting", tree.pos) } } |