aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ProtoTypes.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-02-18 18:44:00 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-02-18 18:54:54 +0100
commit48cd10159573150ed41c86d45c259cf6ad1a0c8e (patch)
tree04728f51325eef76743db0477617731acfdc73cc /src/dotty/tools/dotc/typer/ProtoTypes.scala
parent4be70a5a8469c1355c84bef70936a81f899a9678 (diff)
downloaddotty-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 'src/dotty/tools/dotc/typer/ProtoTypes.scala')
-rw-r--r--src/dotty/tools/dotc/typer/ProtoTypes.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/ProtoTypes.scala b/src/dotty/tools/dotc/typer/ProtoTypes.scala
index 8a758bcc8..7997d1cf4 100644
--- a/src/dotty/tools/dotc/typer/ProtoTypes.scala
+++ b/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -420,6 +420,8 @@ object ProtoTypes {
WildcardType(tp1a.bounds | tp2a.bounds)
else
tp.derivedOrType(tp1a, tp2a)
+ case tp: LazyRef =>
+ WildcardType
case tp: SelectionProto =>
tp.derivedSelectionProto(tp.name, wildApprox(tp.memberProto), NoViewsAllowed)
case tp: ViewProto =>