diff options
author | Martin Odersky <odersky@gmail.com> | 2014-06-26 13:17:55 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-06-26 13:17:55 +0200 |
commit | f600df414d01f44604f47122fe00199842d02baf (patch) | |
tree | 2086922b50dc3d92aa5aa5170d6e0162726f395d /src/dotty/tools/dotc/core/TyperState.scala | |
parent | f823e422478232aa083f3510fa8ce4914ec99d53 (diff) | |
download | dotty-f600df414d01f44604f47122fe00199842d02baf.tar.gz dotty-f600df414d01f44604f47122fe00199842d02baf.tar.bz2 dotty-f600df414d01f44604f47122fe00199842d02baf.zip |
Improved documentation
Added explanations where suggested by Adriaan in his review.
Diffstat (limited to 'src/dotty/tools/dotc/core/TyperState.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TyperState.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TyperState.scala b/src/dotty/tools/dotc/core/TyperState.scala index fd8a534d4..de5e0a961 100644 --- a/src/dotty/tools/dotc/core/TyperState.scala +++ b/src/dotty/tools/dotc/core/TyperState.scala @@ -23,7 +23,13 @@ class TyperState(r: Reporter) extends DotClass with Showable { /** The uninstantiated variables */ def uninstVars = constraint.uninstVars - /** The ephemeral flag */ + /** The ephemeral flag is set as a side effect if an operation accesses + * the underlying type of a type variable. The reason we need this flag is + * that any such operation is not referentially transparent; it might logically change + * its value at the moment the type variable is instantiated. Caching code needs to + * check the ephemeral flag; If the flag is set during an operation, the result + * of that operation should not be cached. + */ def ephemeral: Boolean = false def ephemeral_=(x: Boolean): Unit = () |