@@ -182,6 +182,17 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
182182
183183 private [reflect] case class SymbolKind (accurate : String , sanitized : String , abbreviation : String )
184184
185+ protected def newStubSymbol (owner : Symbol ,
186+ name : Name ,
187+ missingMessage : String ,
188+ isPackage : Boolean = false ): Symbol = {
189+ name match {
190+ case n : TypeName => if (isPackage) new StubPackageClassSymbol (owner, n, missingMessage)
191+ else new StubClassSymbol (owner, n, missingMessage)
192+ case _ => new StubTermSymbol (owner, name.toTermName, missingMessage)
193+ }
194+ }
195+
185196 /** The class for all symbols */
186197 abstract class Symbol protected [Symbols ] (initOwner : Symbol , initPos : Position , initName : Name )
187198 extends SymbolContextApiImpl
@@ -505,9 +516,9 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
505516 * failure to the point when that name is used for something, which is
506517 * often to the point of never.
507518 */
508- def newStubSymbol (name : Name , missingMessage : String , isPackage : Boolean = false ): Symbol = name match {
509- case n : TypeName => if (isPackage) new StubPackageClassSymbol ( this , n, missingMessage) else new StubClassSymbol ( this , n, missingMessage)
510- case _ => new StubTermSymbol (this , name.toTermName , missingMessage)
519+ def newStubSymbol (name : Name , missingMessage : String , isPackage : Boolean = false ): Symbol = {
520+ // Invoke the overriden `newStubSymbol` in Global that gives us access to typer
521+ Symbols . this .newStubSymbol (this , name, missingMessage, isPackage )
511522 }
512523
513524 /** Given a field, construct a term symbol that represents the source construct that gave rise the field */
@@ -3491,7 +3502,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
34913502 private def fail [T ](alt : T ): T = {
34923503 // Avoid issuing lots of redundant errors
34933504 if (! hasFlag(IS_ERROR )) {
3494- globalError(missingMessage)
3505+ globalError(pos, missingMessage)
34953506 if (settings.debug.value)
34963507 (new Throwable ).printStackTrace
34973508
0 commit comments