File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/core/tasty Expand file tree Collapse file tree 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}
1515import NameKinds ._
1616import StdNames .nme
1717import transform .SymUtils ._
18+ import config .Config
1819import collection .mutable
1920import dotty .tools .tasty .TastyFormat .ASTsSection
2021
@@ -85,6 +86,11 @@ class TreePickler(pickler: TastyPickler) {
8586 case Some (label) =>
8687 if (label != NoAddr ) writeRef(label) else pickleForwardSymRef(sym)
8788 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)
8894 pickleForwardSymRef(sym)
8995 }
9096
@@ -197,7 +203,7 @@ class TreePickler(pickler: TastyPickler) {
197203 }
198204 else if (tpe.prefix == NoPrefix ) {
199205 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
201207 report.error(i " pickling reference to as yet undefined $tpe with symbol ${sym}" , sym.srcPos)
202208 pickleSymRef(sym)
203209 }
You can’t perform that action at this time.
0 commit comments