Skip to content

Commit 67a8152

Browse files
committed
use NotAMember error in PostTyper
1 parent 3a72da6 commit 67a8152

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import util.Positions._
1414
import Decorators._
1515
import config.Printers.typr
1616
import Symbols._, TypeUtils._, SymUtils._
17-
import reporting.diagnostic.messages.SuperCallsNotAllowedInline
17+
import reporting.diagnostic.messages.{NotAMember, SuperCallsNotAllowedInline}
1818

1919
/** A macro transform that runs immediately after typer and that performs the following functions:
2020
*
@@ -272,7 +272,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
272272
def checkIdent(ident: untpd.Ident): Unit = {
273273
val name = ident.name.asTermName
274274
if (name != nme.WILDCARD && !exprTpe.member(name).exists && !exprTpe.member(name.toTypeName).exists)
275-
ctx.error(s"${ident.name} is not a member of ${expr.show}", ident.pos)
275+
ctx.error(NotAMember(exprTpe, name, "value"), ident.pos)
276276
}
277277
selectors.foreach {
278278
case ident: untpd.Ident => checkIdent(ident)

0 commit comments

Comments
 (0)