Skip to content

Commit 4df133e

Browse files
author
Jendrik Wenke
committed
call it declaration consistently
1 parent 68dcdec commit 4df133e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,18 +2080,18 @@ object messages {
20802080
val explanation = ""
20812081
}
20822082

2083-
case class DoubleDeclaration(decl: Symbol, previousSymbol: Symbol)(implicit ctx: Context) extends Message(DoubleDeclarationID) {
2083+
case class DoubleDeclaration(decl: Symbol, previousDecl: Symbol)(implicit ctx: Context) extends Message(DoubleDeclarationID) {
20842084
val kind = "Duplicate Symbol"
20852085
val msg = {
2086-
val details = if (decl.isRealMethod && previousSymbol.isRealMethod) {
2086+
val details = if (decl.isRealMethod && previousDecl.isRealMethod) {
20872087
// compare the signatures when both symbols represent methods
2088-
decl.asTerm.signature.matchDegree(previousSymbol.asTerm.signature) match {
2088+
decl.asTerm.signature.matchDegree(previousDecl.asTerm.signature) match {
20892089
case Signature.NoMatch => ""
20902090
case Signature.ParamMatch => "\nOverloads with equal parameter types but different return types are not allowed."
20912091
case Signature.FullMatch => "\nThe definitions have the same signature after erasure."
20922092
}
20932093
} else ""
2094-
hl"${decl.showLocated} is already defined as ${previousSymbol.showDcl} in line ${previousSymbol.pos.line + 1}." + details
2094+
hl"${decl.showLocated} is already defined as ${previousDecl.showDcl} in line ${previousDecl.pos.line + 1}." + details
20952095
}
20962096
val explanation = ""
20972097
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,12 @@ trait Checking {
611611
}
612612
}
613613

614-
/** Check that class does not define same symbol twice */
615-
def checkNoDoubleDefs(cls: Symbol)(implicit ctx: Context): Unit = {
614+
/** Check that class does not declare same symbol twice */
615+
def checkNoDoubleDeclaration(cls: Symbol)(implicit ctx: Context): Unit = {
616616
val seen = new mutable.HashMap[Name, List[Symbol]] {
617617
override def default(key: Name) = Nil
618618
}
619-
typr.println(i"check no double defs $cls")
619+
typr.println(i"check no double declarations $cls")
620620

621621
def checkDecl(decl: Symbol): Unit = {
622622
for (other <- seen(decl.name)) {
@@ -866,7 +866,7 @@ trait NoChecking extends ReChecking {
866866
override def checkImplicitParamsNotSingletons(vparamss: List[List[ValDef]])(implicit ctx: Context): Unit = ()
867867
override def checkFeasibleParent(tp: Type, pos: Position, where: => String = "")(implicit ctx: Context): Type = tp
868868
override def checkInlineConformant(tree: Tree, what: => String)(implicit ctx: Context) = ()
869-
override def checkNoDoubleDefs(cls: Symbol)(implicit ctx: Context): Unit = ()
869+
override def checkNoDoubleDeclaration(cls: Symbol)(implicit ctx: Context): Unit = ()
870870
override def checkParentCall(call: Tree, caller: ClassSymbol)(implicit ctx: Context) = ()
871871
override def checkSimpleKinded(tpt: Tree)(implicit ctx: Context): Tree = tpt
872872
override def checkNotSingleton(tpt: Tree, where: String)(implicit ctx: Context): Tree = tpt

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ class Typer extends Namer
15061506
// Expand comments and type usecases
15071507
cookComments(body1.map(_.symbol), self1.symbol)(ctx.localContext(cdef, cls).setNewScope)
15081508

1509-
checkNoDoubleDefs(cls)
1509+
checkNoDoubleDeclaration(cls)
15101510
val impl1 = cpy.Template(impl)(constr1, parents1, self1, body1)
15111511
.withType(dummy.termRef)
15121512
checkVariance(impl1)

0 commit comments

Comments
 (0)