diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-04-11 15:36:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-11 15:36:02 +0200 |
commit | 9917029becab32d56e786ac9309ee195737f6da0 (patch) | |
tree | 27319d8a4d45cf389796abd7a1be7fe862839e33 | |
parent | 92a9d05fd64ac97140aa0f01214c4738526383c3 (diff) | |
parent | ad6c683596f12a8e868c8c6f8ce2a4855146daca (diff) | |
download | dotty-9917029becab32d56e786ac9309ee195737f6da0.tar.gz dotty-9917029becab32d56e786ac9309ee195737f6da0.tar.bz2 dotty-9917029becab32d56e786ac9309ee195737f6da0.zip |
Merge pull request #2222 from dotty-staging/fix/wildcard-apply
Fix #2219: Fix type applications on WildcardType
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeApplications.scala | 2 | ||||
-rw-r--r-- | tests/pos/i2219.scala | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 82051b66c..b37ed2b0a 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -429,7 +429,7 @@ class TypeApplications(val self: Type) extends AnyVal { case dealiased: LazyRef => LazyRef(() => dealiased.ref.appliedTo(args)) case dealiased: WildcardType => - dealiased + WildcardType(dealiased.optBounds.appliedTo(args).bounds) case dealiased: TypeRef if dealiased.symbol == defn.NothingClass => dealiased case _ if typParams.isEmpty || typParams.head.isInstanceOf[LambdaParam] => diff --git a/tests/pos/i2219.scala b/tests/pos/i2219.scala new file mode 100644 index 000000000..7f786eb3e --- /dev/null +++ b/tests/pos/i2219.scala @@ -0,0 +1,7 @@ +object Test { + type Inv[T[_]] = T[_] + + class Hi[T[_]](x: Inv[T]) { + def foo[T[_]](value: Inv[T] = x) = {} + } +} |