We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f36967c commit 2cd48ebCopy full SHA for 2cd48eb
compiler/src/dotty/tools/dotc/core/TypeEval.scala
@@ -64,7 +64,12 @@ object TypeEval:
64
// currently not a concrete known type
65
case _: TypeParamRef => None
66
// constant if the term is constant
67
- case t: TermRef => isConst(t.underlying)
+ case t: TermRef =>
68
+ if t.denot.symbol.flagsUNSAFE.is(Flags.Param) then
69
+ // might be substituted later
70
+ None
71
+ else
72
+ isConst(t.underlying)
73
// an operation type => recursively check all argument compositions
74
case applied: AppliedType if defn.isCompiletimeAppliedType(applied.typeSymbol) =>
75
val argsConst = applied.args.map(isConst)
@@ -239,4 +244,4 @@ object TypeEval:
239
244
240
245
case _ => NoType
241
246
end tryCompiletimeConstantFold
242
-end TypeEval
247
+end TypeEval
0 commit comments