Skip to content

Commit 405ace0

Browse files
committed
Drop BodyOfTransparent mode bit
- premature optimization, we can just inspect the owner chain, - if we need it, it should be an automatically updated cache
1 parent 174943b commit 405ace0

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

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

-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,4 @@ object Mode {
9393

9494
/** We are in the IDE */
9595
val Interactive = newMode(20, "Interactive")
96-
97-
/** We are typing the body of a transparent method */
98-
val TransparentBody = newMode(21, "TransparentBody")
9996
}

compiler/src/dotty/tools/dotc/typer/Namer.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,7 @@ class Namer { typer: Typer =>
11281128
// it would be erased to BoxedUnit.
11291129
def dealiasIfUnit(tp: Type) = if (tp.isRef(defn.UnitClass)) defn.UnitType else tp
11301130

1131-
var rhsCtx = ctx.addMode(Mode.InferringReturnType)
1132-
if (sym.isTransparentMethod) rhsCtx = rhsCtx.addMode(Mode.TransparentBody)
1131+
val rhsCtx = ctx.addMode(Mode.InferringReturnType)
11331132
def rhsType = typedAheadExpr(mdef.rhs, inherited orElse rhsProto)(rhsCtx).tpe
11341133

11351134
// Approximate a type `tp` with a type that does not contain skolem types.

0 commit comments

Comments
 (0)