File tree 1 file changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/core/tasty
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import Comments.{Comment, CommentsContext}
15
15
import NameKinds ._
16
16
import StdNames .nme
17
17
import transform .SymUtils ._
18
+ import config .Config
18
19
import collection .mutable
19
20
import dotty .tools .tasty .TastyFormat .ASTsSection
20
21
@@ -85,6 +86,11 @@ class TreePickler(pickler: TastyPickler) {
85
86
case Some (label) =>
86
87
if (label != NoAddr ) writeRef(label) else pickleForwardSymRef(sym)
87
88
case None =>
89
+ // See pos/t1957.scala for an example where this can happen.
90
+ // I believe it's a bug in typer: the type of an implicit argument refers
91
+ // to a closure parameter outside the closure itself. TODO: track this down, so that we
92
+ // can eliminate this case.
93
+ report.log(i " pickling reference to as yet undefined $sym in ${sym.owner}" , sym.srcPos)
88
94
pickleForwardSymRef(sym)
89
95
}
90
96
@@ -197,7 +203,7 @@ class TreePickler(pickler: TastyPickler) {
197
203
}
198
204
else if (tpe.prefix == NoPrefix ) {
199
205
writeByte(if (tpe.isType) TYPEREFdirect else TERMREFdirect )
200
- if ! symRefs.contains(sym) && ! sym.isPatternBound && ! sym.hasAnnotation(defn.QuotedRuntimePatterns_patternTypeAnnot ) then
206
+ if Config .checkLevels && ! symRefs.contains(sym) && ! sym.isPatternBound && ! sym.hasAnnotation(defn.QuotedRuntimePatterns_patternTypeAnnot ) then
201
207
report.error(i " pickling reference to as yet undefined $tpe with symbol ${sym}" , sym.srcPos)
202
208
pickleSymRef(sym)
203
209
}
You can’t perform that action at this time.
0 commit comments