diff options
author | Miles Sabin <miles@milessabin.com> | 2016-08-10 09:30:49 +0100 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2016-11-28 10:49:43 +0000 |
commit | dde13b56f421a6f956abebc58f041acec8744149 (patch) | |
tree | da787e48245d7ddb62fe4f1e1224ebae89fdc161 /src/compiler/scala/tools/nsc/Global.scala | |
parent | 690ba800ec04f05c0f5e5e369863ab5b9578d42f (diff) | |
download | scala-dde13b56f421a6f956abebc58f041acec8744149.tar.gz scala-dde13b56f421a6f956abebc58f041acec8744149.tar.bz2 scala-dde13b56f421a6f956abebc58f041acec8744149.zip |
Partial fix for SI-7046
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index a7880c72d7..69a54193e0 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -182,6 +182,19 @@ class Global(var currentSettings: Settings, var reporter: Reporter) } } + private var propCnt = 0 + @inline final def withPropagateCyclicReferences[T](t: => T): T = { + try { + propCnt = propCnt+1 + t + } finally { + propCnt = propCnt-1 + assert(propCnt >= 0) + } + } + + def propagateCyclicReferences: Boolean = propCnt > 0 + /** Representing ASTs as graphs */ object treeBrowsers extends { val global: Global.this.type = Global.this |