File tree 2 files changed +14
-1
lines changed
compiler/src/dotty/tools/dotc/ast
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -510,7 +510,9 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
510
510
*/
511
511
def constToLiteral (tree : Tree )(implicit ctx : Context ): Tree = {
512
512
val tree1 = ConstFold (tree)
513
- tree1.tpe.widenTermRefExpr.dealias match {
513
+ val deepDealias = new TypeMap :
514
+ def apply (tp : Type ): Type = mapOver(tp.dealias)
515
+ tree1.tpe.widenTermRefExpr.dealias.normalized match {
514
516
case ConstantType (value) =>
515
517
if (isIdempotentExpr(tree1)) Literal (value).withSpan(tree.span)
516
518
else tree1 match {
Original file line number Diff line number Diff line change
1
+ class C :
2
+ type X <: Tuple
3
+
4
+ inline def f (c : C ): Unit = {
5
+ inline val size = compiletime.constValue[Tuple .Size [c.X ]]
6
+ val n = size
7
+ val m : Int = n
8
+ ???
9
+ }
10
+
11
+ def test : Unit = f(??? : C { type X = Tuple1 [Any ] })
You can’t perform that action at this time.
0 commit comments