From be53234352f75aca456ed131163b45230e4638af Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 4 Sep 2016 18:39:50 +0200 Subject: Add comment missing from last PR --- src/dotty/tools/dotc/core/TyperState.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/dotty/tools') diff --git a/src/dotty/tools/dotc/core/TyperState.scala b/src/dotty/tools/dotc/core/TyperState.scala index 7b8867ccc..3ed4788ee 100644 --- a/src/dotty/tools/dotc/core/TyperState.scala +++ b/src/dotty/tools/dotc/core/TyperState.scala @@ -122,6 +122,18 @@ extends TyperState(r) { * type variables changes from this typer state to the current one. (2) Variables * that were temporarily instantiated in the current typer state are permanently * instantiated instead. + * + * A note on merging: A case is in isApplicableSafe.scala. It turns out that this + * requires a context merge using the new `&' operator. Sequence of actions: + * 1) Typecheck argument in typerstate 1. + * 2) Cache argument. + * 3) Evolve same typer state (to typecheck other arguments, say) + * leading to a different constraint. + * 4) Take typechecked argument in same state. + * + * It turns out that the merge is needed not just for + * isApplicableSafe but also for (e.g. erased-lubs.scala) as well as + * many parts of dotty itself. */ override def commit()(implicit ctx: Context) = { val targetState = ctx.typerState -- cgit v1.2.3