File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,14 @@ class CacheAliasImplicits extends MiniPhase with IdentityDenotTransformer { this
49
49
50
50
override def transformDefDef (tree : DefDef )(implicit ctx : Context ): Tree = {
51
51
val sym = tree.symbol
52
- val rhsType = tree.rhs.tpe
53
- val isCached = ! sym.is(Inline ) && {
52
+ val isCached = sym.is(Inline ) && {
54
53
sym.info match {
55
- case _ : ExprType if sym.is(Given , butNot = CacheAliasImplicits .NoCacheFlags ) =>
56
- rhsType match {
57
- case TermRef (NoPrefix , _)
58
- if rhsType .isStable => false
59
- case TermRef (pre : ThisType , _)
60
- if rhsType .isStable && pre.cls == sym.owner.enclosingClass => false
54
+ case ExprType (resTpe) if sym.is(Given , butNot = CacheAliasImplicits .NoCacheFlags ) =>
55
+ tree.rhs.tpe match {
56
+ case rhsTpe @ TermRef (NoPrefix , _)
57
+ if rhsTpe .isStable => false
58
+ case rhsTpe @ TermRef (pre : ThisType , _)
59
+ if rhsTpe .isStable && pre.cls == sym.owner.enclosingClass => false
61
60
case _ => true
62
61
}
63
62
case _ => false
@@ -66,7 +65,7 @@ class CacheAliasImplicits extends MiniPhase with IdentityDenotTransformer { this
66
65
if (isCached) {
67
66
sym.copySymDenotation(
68
67
initFlags = sym.flags &~ Method | Lazy ,
69
- info = rhsType )
68
+ info = sym.info.widenExpr )
70
69
.installAfter(thisPhase)
71
70
cpy.ValDef (tree)(tree.name, tree.tpt, tree.rhs)
72
71
}
You can’t perform that action at this time.
0 commit comments