Skip to content

Commit 1ab7ddb

Browse files
q-ataolhotak
andauthored
Apply suggestions from code review
Co-authored-by: Ondřej Lhoták <olhotak@uwaterloo.ca>
1 parent e5fc8c8 commit 1ab7ddb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/src/dotty/tools/dotc/transform/init/Objects.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,12 @@ object Objects:
708708
extendTrace(code) { eval(ddef.rhs, thisV, klass, cacheResult = true) }
709709
else
710710
meth.owner.asType.name match
711+
// The methods defined in `Any` and `AnyRef` are trivial and don't affect initialization.
711712
case tpnme.Any | tpnme.AnyRef =>
712713
value
713714
case _ =>
715+
// In future, we will have Tasty for stdlib classes and can abstractly interpret that Tasty.
716+
// For now, return `Cold` to ensure soundness and trigger a warning.
714717
Cold
715718
end if
716719

0 commit comments

Comments
 (0)