Skip to content

Commit 2589824

Browse files
committed
Mark arguments as constructor only
1 parent 5bd83ae commit 2589824

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Errors._
1818

1919
import scala.collection.mutable
2020
import scala.annotation.tailrec
21+
import scala.annotation.constructorOnly
2122

2223
object Semantic {
2324

@@ -98,7 +99,7 @@ object Semantic {
9899
}
99100

100101
/** A reference to the object under initialization pointed by `this` */
101-
case class ThisRef(klass: ClassSymbol)(using Heap) extends Ref {
102+
case class ThisRef(klass: ClassSymbol)(using @constructorOnly h: Heap) extends Ref {
102103
val outer = Hot
103104

104105
ensureObjectExists()
@@ -108,7 +109,7 @@ object Semantic {
108109
*
109110
* We need to restrict nesting levels of `outer` to finitize the domain.
110111
*/
111-
case class Warm(klass: ClassSymbol, outer: Value, ctor: Symbol, args: List[Value])(using Heap) extends Ref {
112+
case class Warm(klass: ClassSymbol, outer: Value, ctor: Symbol, args: List[Value])(using @constructorOnly h: Heap) extends Ref {
112113
ensureObjectExists()
113114
}
114115

0 commit comments

Comments
 (0)