From 850dc6f2fb3b6228f2586ce0790621e80f664afe Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 29 Jun 2016 19:04:03 +0200 Subject: Introduce recursive types Map self-references in refinements to recursive types. This commit does this for refinement types appearing in source. We still have to do it for unpickled refinements. Test apply-equiv got moved to pending because it simulates the old higher-kinded type encoding in source, which relies on the old representation in terms of self-referential refinement types. The plan is not to adapt this encoding to the new representation, but to replace it with a different encoding that makes critical use of the added power of recursive types. Use recursive types also when unpickling from Scala 2.x. Add mapInfo method to Denotations. --- tests/pending/pos/apply-equiv.scala | 14 ++++++++++++++ tests/pos/apply-equiv.scala | 14 -------------- tests/pos/lookuprefined.scala | 6 ++++-- 3 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 tests/pending/pos/apply-equiv.scala delete mode 100644 tests/pos/apply-equiv.scala (limited to 'tests') diff --git a/tests/pending/pos/apply-equiv.scala b/tests/pending/pos/apply-equiv.scala new file mode 100644 index 000000000..f53b8b5ab --- /dev/null +++ b/tests/pending/pos/apply-equiv.scala @@ -0,0 +1,14 @@ +class Test { + + class Lambda { type Arg; type Apply } + + type T1 = (Lambda { type Arg = Int } { type Apply = List[Arg] }) # Apply + type T2 = List[Int] + + var x: T1 = _ + var y: T2 = _ + + x = y + y = x + +} diff --git a/tests/pos/apply-equiv.scala b/tests/pos/apply-equiv.scala deleted file mode 100644 index f53b8b5ab..000000000 --- a/tests/pos/apply-equiv.scala +++ /dev/null @@ -1,14 +0,0 @@ -class Test { - - class Lambda { type Arg; type Apply } - - type T1 = (Lambda { type Arg = Int } { type Apply = List[Arg] }) # Apply - type T2 = List[Int] - - var x: T1 = _ - var y: T2 = _ - - x = y - y = x - -} diff --git a/tests/pos/lookuprefined.scala b/tests/pos/lookuprefined.scala index f7e7f7337..9dd2b4abb 100644 --- a/tests/pos/lookuprefined.scala +++ b/tests/pos/lookuprefined.scala @@ -2,7 +2,9 @@ class C { type T; type U } trait Test { - val x: (C { type U = T } { type T = String }) # U - val y: String = x + val x1: (C { type U = T; type T = String }) # U + val x2: (C { type U = T } {type T = String }) # U + val y1: String = x1 + val y2: String = x2 } -- cgit v1.2.3