diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-02-18 18:44:00 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-02-18 18:54:54 +0100 |
commit | 48cd10159573150ed41c86d45c259cf6ad1a0c8e (patch) | |
tree | 04728f51325eef76743db0477617731acfdc73cc /tests/pos | |
parent | 4be70a5a8469c1355c84bef70936a81f899a9678 (diff) | |
download | dotty-48cd10159573150ed41c86d45c259cf6ad1a0c8e.tar.gz dotty-48cd10159573150ed41c86d45c259cf6ad1a0c8e.tar.bz2 dotty-48cd10159573150ed41c86d45c259cf6ad1a0c8e.zip |
ProtoTypes#wildApprox: fix LazyRef approximation
Before this commit, the output of `wildApprox(A)` where `A <: Sys[LazyRef(A)]` was
`? <: Sys[LazyRef(() => wildApprox(A))]`. This lead to infinite
subtyping checks.
This is fixed by always approximating a LazyRef by an unbounded
wildcard. Since we only create LazyRefs when we encounter a cycle, this
should be safe.
Fix #1103.
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/i1103.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/pos/i1103.scala b/tests/pos/i1103.scala new file mode 100644 index 000000000..dcc391a6a --- /dev/null +++ b/tests/pos/i1103.scala @@ -0,0 +1,5 @@ +class Sys[S] +class Foo[T <: Sys[T]] { + val t: T = ??? + def foo[A <: Sys[A]](x: A = t) = x +} |