You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, the nesting level of a symbol was always equal to the
nesting level of its owner incremented by one, but in a situation like
i8900a.scala where we have:
...
val a = unwrap[?Outer]({
class Local
...
the owner of both `?Outer` and `Local` is `a`, and so they ended up with
the same level even though `Local` should not leak outside of the block
that defines it (i8900a.scala compiled regardless due to the disabled
check for forward references in TreePickler re-enabled later in this PR).
We rectify this by associating each scope with a level which is always
greated than the level of the enclosing scope (repurposing the existing
Scope#nestingLevel method which wasn't used for anything), newly created
symbols then simply take the level of the current scope (this required
tweaking typedCase so that the pattern symbols were typed in the scope
were they end up being entered).
Also add a `-Yprint-level` option for debugging level-related issues.
valYprintSyms:Setting[Boolean] =BooleanSetting("-Yprint-syms", "When printing trees print info in symbols instead of corresponding info in trees.")
275
275
valYprintDebug:Setting[Boolean] =BooleanSetting("-Yprint-debug", "When printing trees, print some extra information useful for debugging.")
276
276
valYprintDebugOwners:Setting[Boolean] =BooleanSetting("-Yprint-debug-owners", "When printing trees, print owners of definitions.")
277
+
valYprintLevel:Setting[Boolean] =BooleanSetting("-Yprint-level", "print nesting levels of symbols and type variables.")
277
278
valYshowPrintErrors:Setting[Boolean] =BooleanSetting("-Yshow-print-errors", "Don't suppress exceptions thrown during tree printing.")
278
279
valYtestPickler:Setting[Boolean] =BooleanSetting("-Ytest-pickler", "Self-test for pickling functionality; should be used with -Ystop-after:pickler.")
279
280
valYcheckReentrant:Setting[Boolean] =BooleanSetting("-Ycheck-reentrant", "Check that compiled program does not contain vars that can be accessed from a global root.")
0 commit comments