diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-10-18 10:34:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-18 10:34:55 -0700 |
commit | c6a1e947004a4582e4daf7e7a330b30f27dccc61 (patch) | |
tree | 2a88944622e2924ef0a8f2388d71f39310d1564f | |
parent | 4f3f008c058f7a448bd05a0b5dfcb2a931481c8c (diff) | |
parent | e5b51d8fec29048f94445c9b2b258b24245bb920 (diff) | |
download | scala-c6a1e947004a4582e4daf7e7a330b30f27dccc61.tar.gz scala-c6a1e947004a4582e4daf7e7a330b30f27dccc61.tar.bz2 scala-c6a1e947004a4582e4daf7e7a330b30f27dccc61.zip |
Merge pull request #5341 from milessabin/topci/si-9760-backport
SI-9760 Fix for higher-kinded GADT refinement
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 1 | ||||
-rw-r--r-- | test/files/pos/hkgadt.scala | 18 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 9f7bdf7aff..c188c326c3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -1254,7 +1254,6 @@ trait Infer extends Checkable { def isFreeTypeParamOfTerm(sym: Symbol) = ( sym.isAbstractType && sym.owner.isTerm - && !sym.info.bounds.exists(_.typeParams.nonEmpty) ) // Intentionally *not* using `Type#typeSymbol` here, which would normalize `tp` diff --git a/test/files/pos/hkgadt.scala b/test/files/pos/hkgadt.scala new file mode 100644 index 0000000000..efd7d3df21 --- /dev/null +++ b/test/files/pos/hkgadt.scala @@ -0,0 +1,18 @@ +package test + +object HKGADT { + sealed trait Foo[F[_]] + final case class Bar() extends Foo[List] + + def frob[F[_]](foo: Foo[F]): F[Int] = + foo match { + case Bar() => + List(1) + } + + sealed trait Foo1[F] + final case class Bar1() extends Foo1[Int] + def frob1[A](foo: Foo1[A]) = foo match { + case Bar1() => 1 + } +} |