File tree 2 files changed +26
-1
lines changed
compiler/src/dotty/tools/dotc/ast
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -1079,7 +1079,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
1079
1079
case Inlined (_, Nil , expr) => unapply(expr)
1080
1080
case Block (Nil , expr) => unapply(expr)
1081
1081
case _ =>
1082
- tree.tpe.widenTermRefExpr.normalized match
1082
+ tree.tpe.widenTermRefExpr.dealias. normalized match
1083
1083
case ConstantType (Constant (x)) => Some (x)
1084
1084
case _ => None
1085
1085
}
Original file line number Diff line number Diff line change
1
+ trait Logger {
2
+ inline def debug : debug = valueOf[debug]
3
+ final type debug = false
4
+
5
+ // fails
6
+ inline final def log (inline s : String ): Unit =
7
+ inline if (debug) println(s)
8
+ }
9
+
10
+ trait BaseLogger extends Logger {
11
+ // fails
12
+ def bar () = log(" case1" )
13
+ }
14
+
15
+ object Logger {
16
+ inline def log (s : String ): Unit =
17
+ inline if (valueOf[Logger # debug]) println(s)
18
+ }
19
+
20
+ class Test :
21
+ def fails (x : BaseLogger ) =
22
+ x.log(" case2" )
23
+
24
+ def works =
25
+ Logger .log(" case3" )
You can’t perform that action at this time.
0 commit comments