@@ -274,25 +274,14 @@ class Namer { typer: Typer =>
274
274
275
275
val inSuperCall = if (ctx.mode is Mode .InSuperCall ) InSuperCall else EmptyFlags
276
276
277
- /** The position of the name defined by `tree`
278
- * This is a point position if tree is synthetic, a range position if it comes from source.
279
- * It might also be that tree does not have a position (for instance when synthesized by
280
- * a calling chain from `viewExists`), in that case the return position is NoPosition.
281
- */
282
- def namePos (tree : MemberDef ) =
283
- if (tree.pos.exists)
284
- if (tree.mods.is(Synthetic )) Position (tree.pos.point, tree.pos.point)
285
- else Position (tree.pos.point, tree.pos.point + tree.name.length, tree.pos.point)
286
- else tree.pos
287
-
288
277
tree match {
289
278
case tree : TypeDef if tree.isClassDef =>
290
279
val name = checkNoConflict(tree.name.encode).asTypeName
291
280
val flags = checkFlags(tree.mods.flags &~ Implicit )
292
281
val cls = recordSym(ctx.newClassSymbol(
293
282
ctx.owner, name, flags | inSuperCall,
294
283
cls => adjustIfModule(new ClassCompleter (cls, tree)(ctx), tree),
295
- privateWithinClass(tree.mods), namePos( tree) , ctx.source.file), tree)
284
+ privateWithinClass(tree.mods), tree.namePos , ctx.source.file), tree)
296
285
cls.completer.asInstanceOf [ClassCompleter ].init()
297
286
cls
298
287
case tree : MemberDef =>
@@ -327,7 +316,7 @@ class Namer { typer: Typer =>
327
316
recordSym(ctx.newSymbol(
328
317
ctx.owner, name, flags | deferred | method | higherKinded | inSuperCall1,
329
318
adjustIfModule(completer, tree),
330
- privateWithinClass(tree.mods), namePos( tree) ), tree)
319
+ privateWithinClass(tree.mods), tree.namePos ), tree)
331
320
case tree : Import =>
332
321
recordSym(ctx.newSymbol(
333
322
ctx.owner, nme.IMPORT , Synthetic , new Completer (tree), NoSymbol , tree.pos), tree)
0 commit comments