aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ProtoTypes.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-06-20 13:01:16 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 13:35:03 +0200
commit98b466c14cda8ea5a9d2e8efdfada5b735bb4d95 (patch)
tree4f256a51a0ffdc10548f479b484114317e5797b5 /src/dotty/tools/dotc/typer/ProtoTypes.scala
parentc1e27a035cccda42542e24f3fa6a57c6955c9923 (diff)
downloaddotty-98b466c14cda8ea5a9d2e8efdfada5b735bb4d95.tar.gz
dotty-98b466c14cda8ea5a9d2e8efdfada5b735bb4d95.tar.bz2
dotty-98b466c14cda8ea5a9d2e8efdfada5b735bb4d95.zip
Ensure wildApprox maintains kinds
When approximating the constructor of an ak apply to a wildcard type, approximate the whole application by WildcardType. Otherwise we might have a wildcardtype with hk bounds as result.
Diffstat (limited to 'src/dotty/tools/dotc/typer/ProtoTypes.scala')
-rw-r--r--src/dotty/tools/dotc/typer/ProtoTypes.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/ProtoTypes.scala b/src/dotty/tools/dotc/typer/ProtoTypes.scala
index 9a1337022..3a13212a3 100644
--- a/src/dotty/tools/dotc/typer/ProtoTypes.scala
+++ b/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -405,6 +405,11 @@ object ProtoTypes {
WildcardType(TypeBounds.upper(wildApprox(mt.paramTypes(pnum))))
case tp: TypeVar =>
wildApprox(tp.underlying)
+ case tp @ HKApply(tycon, args) =>
+ wildApprox(tycon) match {
+ case _: WildcardType => WildcardType // this ensures we get a * type
+ case tycon1 => tp.derivedAppliedType(tycon1, args.mapConserve(wildApprox(_)))
+ }
case tp: AndType =>
val tp1a = wildApprox(tp.tp1)
val tp2a = wildApprox(tp.tp2)