From f600df414d01f44604f47122fe00199842d02baf Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 26 Jun 2014 13:17:55 +0200 Subject: Improved documentation Added explanations where suggested by Adriaan in his review. --- src/dotty/tools/dotc/core/TyperState.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/TyperState.scala') 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 = () -- cgit v1.2.3