Skip to content

Commit cb42f1e

Browse files
committed
Also use precise refinements for tracked parameters
1 parent d56080e commit cb42f1e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/core/NamerOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ object NamerOps:
5252
*/
5353
def addParamRefinements(resType: Type, paramss: List[List[Symbol]])(using Context): Type =
5454
paramss.flatten.foldLeft(resType): (rt, param) =>
55-
if param.is(Tracked) then RefinedType(rt, param.name, param.termRef)
55+
if param.is(Tracked) then RefinedType.precise(rt, param.name, param.termRef)
5656
else rt
5757

5858
/** Split dependent class refinements off parent type. Add them to `refinements`,

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,9 +914,7 @@ object Types extends TypeUtils {
914914
pdenot.asSingleDenotation.derivedSingleDenotation(pdenot.symbol, jointInfo)
915915
}
916916
else
917-
val overridingRefinement =
918-
tp.isPrecise || pdenot.symbol.is(Tracked)
919-
if overridingRefinement then
917+
if tp.isPrecise then
920918
pdenot.asSingleDenotation.derivedSingleDenotation(pdenot.symbol, rinfo)
921919
else
922920
val isRefinedMethod = rinfo.isInstanceOf[MethodOrPoly]

0 commit comments

Comments
 (0)