Skip to content

Commit e7f5c26

Browse files
committed
Revert "Check that we pickle a definition before its references"
This reverts commit ae1b00d.
1 parent 2317859 commit e7f5c26

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala

+5-2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ class TreePickler(pickler: TastyPickler) {
8585
case Some(label) =>
8686
if (label != NoAddr) writeRef(label) else pickleForwardSymRef(sym)
8787
case None =>
88+
// See pos/t1957.scala for an example where this can happen.
89+
// I believe it's a bug in typer: the type of an implicit argument refers
90+
// to a closure parameter outside the closure itself. TODO: track this down, so that we
91+
// can eliminate this case.
92+
report.log(i"pickling reference to as yet undefined $sym in ${sym.owner}", sym.srcPos)
8893
pickleForwardSymRef(sym)
8994
}
9095

@@ -197,8 +202,6 @@ class TreePickler(pickler: TastyPickler) {
197202
}
198203
else if (tpe.prefix == NoPrefix) {
199204
writeByte(if (tpe.isType) TYPEREFdirect else TERMREFdirect)
200-
if !symRefs.contains(sym) && !sym.isPatternBound && !sym.hasAnnotation(defn.QuotedRuntimePatterns_patternTypeAnnot) then
201-
report.error(i"pickling reference to as yet undefined $tpe with symbol ${sym}", sym.srcPos)
202205
pickleSymRef(sym)
203206
}
204207
else tpe.designator match {

0 commit comments

Comments
 (0)