We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37bc11d commit 2bbd0e4Copy full SHA for 2bbd0e4
compiler/src/dotty/tools/dotc/ast/TreeInfo.scala
@@ -510,7 +510,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
510
*/
511
def constToLiteral(tree: Tree)(implicit ctx: Context): Tree = {
512
val tree1 = ConstFold(tree)
513
- tree1.tpe.widenTermRefExpr.dealias match {
+ tree1.tpe.widenTermRefExpr.dealias.normalized match {
514
case ConstantType(value) =>
515
if (isIdempotentExpr(tree1)) Literal(value).withSpan(tree.span)
516
else tree1 match {
tests/pos/i8843.scala
@@ -0,0 +1,11 @@
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] })
0 commit comments