diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-05-16 04:54:51 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-05-16 04:54:51 -0700 |
commit | 9fe251e16b93d4bdc8a496f3edce90ef2e207ee8 (patch) | |
tree | 84fd85c9af088ea832ae68a7443083e868c24acf /src/compiler | |
parent | 8a42d535dbef45bc18cf4232912842dddd85d1e4 (diff) | |
parent | 7d79c4460814c9f8997de0fa1d756a734fb8a3d3 (diff) | |
download | scala-9fe251e16b93d4bdc8a496f3edce90ef2e207ee8.tar.gz scala-9fe251e16b93d4bdc8a496f3edce90ef2e207ee8.tar.bz2 scala-9fe251e16b93d4bdc8a496f3edce90ef2e207ee8.zip |
Merge pull request #558 from lrytz/wip/t5259
Fix SI-5259
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala index bef6f13bc3..8ae254d35d 100644 --- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala +++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala @@ -158,20 +158,20 @@ trait NamesDefaults { self: Analyzer => // it stays in Vegas: SI-5720, SI-5727 qual changeOwner (blockTyper.context.owner -> sym) + val newQual = atPos(qual.pos.focus)(blockTyper.typedQualifier(Ident(sym.name))) var baseFunTransformed = atPos(baseFun.pos.makeTransparent) { - // don't use treeCopy: it would assign opaque position. - val f = Select(gen.mkAttributedRef(sym), selected) - .setType(baseFun1.tpe).setSymbol(baseFun1.symbol) + // setSymbol below is important because the 'selected' function might be overloaded. by + // assigning the correct method symbol, typedSelect will just assign the type. the reason + // to still call 'typed' is to correctly infer singleton types, SI-5259. + val f = blockTyper.typedOperator(Select(newQual, selected).setSymbol(baseFun1.symbol)) if (funTargs.isEmpty) f else TypeApply(f, funTargs).setType(baseFun.tpe) } val b = Block(List(vd), baseFunTransformed) .setType(baseFunTransformed.tpe).setPos(baseFun.pos) - - val defaultQual = Some(atPos(qual.pos.focus)(gen.mkAttributedRef(sym))) context.namedApplyBlockInfo = - Some((b, NamedApplyInfo(defaultQual, defaultTargs, Nil, blockTyper))) + Some((b, NamedApplyInfo(Some(newQual), defaultTargs, Nil, blockTyper))) b } |