aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TyperState.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-04 18:39:50 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:11:21 +0200
commitbe53234352f75aca456ed131163b45230e4638af (patch)
treec30f661ed056bf81df1dfe9494b8f92bcb733330 /src/dotty/tools/dotc/core/TyperState.scala
parent379bb24e55d88434faa32d2d324fcadb42af960d (diff)
downloaddotty-be53234352f75aca456ed131163b45230e4638af.tar.gz
dotty-be53234352f75aca456ed131163b45230e4638af.tar.bz2
dotty-be53234352f75aca456ed131163b45230e4638af.zip
Add comment missing from last PR
Diffstat (limited to 'src/dotty/tools/dotc/core/TyperState.scala')
-rw-r--r--src/dotty/tools/dotc/core/TyperState.scala12
1 files changed, 12 insertions, 0 deletions
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