Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/init/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1683,10 +1683,12 @@ class Objects:
end if

// class body
val whiteList = Set("scala.collection.immutable.Vector.emptyIterator")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use a Definition here (from dotty.tools.dotc.core.Definitions) instead of a plain String, unless there is some reason not to.

tpl.body.foreach {
case vdef : ValDef if !vdef.symbol.is(Flags.Lazy) && !vdef.rhs.isEmpty =>
val res = eval(vdef.rhs, thisV, klass)
var res = eval(vdef.rhs, thisV, klass)
val sym = vdef.symbol
if (whiteList.contains(sym.showFullName)) res = Bottom
if sym.is(Flags.Mutable) then
val addr = Heap.fieldVarAddr(summon[Regions.Data], sym, State.currentObject)
thisV.initVar(sym, addr)
Expand Down