aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/t1957.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/t1957.scala')
-rw-r--r--tests/pos/t1957.scala29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/pos/t1957.scala b/tests/pos/t1957.scala
index 711ce17de..2ac7f0414 100644
--- a/tests/pos/t1957.scala
+++ b/tests/pos/t1957.scala
@@ -1,3 +1,4 @@
+// See comment at end of file.
object Test {
abstract class Settings {}
@@ -30,8 +31,32 @@ object Test {
protected def f: List[commonModuleType] =
{
- val inputGrists = tools.flatMap(_.inputGrist) // val inputGrists: List[gristType] =
- inputGrists.map(_.module)
+ val inputGrists = tools.flatMap(_.inputGrist)
+ // This produces an unhygienic closure for _.inputGrist.
+ // Pickling will log:
+ //
+ // [...] pickling reference to as yet undefined value _$1 in method $anonfun
+ //
+ // More info can be produced by uncommenting these two lines in
+ // Namer#valOrDefDefSig:
+ //
+ //println(i"lifting $rhsType over $paramss -> $hygienicType = ${tpt.tpe}")
+ //println(TypeComparer.explained { implicit ctx => hygienicType <:< tpt.tpe })
+ //
+ // Tracing the subtype statement (over 1600+ lines!) shows that the TypeComparer thinks that the
+ // following subtype judgement is true:
+ //
+ // Test.Grist{
+ // moduleType <: Test.Module{settingsType = Module.this.settingsType};
+ // settingsType <: Module.this.settingsType
+ // } <:< Test.Grist{moduleType <: _$1.moduleType; settingsType <: _$1.settingsType}
+ //
+ // Therefore, a type variable which has the second type as lower bound does not get
+ // the (hygienic) first type as new lower bound. Clearly something is wrong in the subtype
+ // derivation here. It would be important to figure out what.
+
+ ???
+// inputGrists.map(_.module)
}
}