Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
[Cherry-picked 36b4949]
  • Loading branch information
EnzeXing authored and WojciechMazur committed Aug 28, 2024
1 parent eae6a33 commit f8659a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/init/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,10 @@ class Objects(using Context @constructorOnly):
Bottom
}

/** Handle new expression `new p.C(args)`.
/**
* Handle new expression `new p.C(args)`.
* The actual instance might be cached without running the constructor.
* See tests/init-global/pos/cache-constructor.scala
*
* @param outer The value for `p`.
* @param klass The symbol of the class `C`.
Expand Down
1 change: 0 additions & 1 deletion tests/init-global/pos/cache-constructor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ object A:
val b2 = new Bar()
val b3 = new Bar()
b3.f = 1

0 comments on commit f8659a9

Please sign in to comment.