diff options
author | Miles Sabin <miles@milessabin.com> | 2016-04-19 11:35:40 +0100 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2016-04-19 17:22:35 +0100 |
commit | 9ec6278e05f6acd471473342067e922cb85293d6 (patch) | |
tree | e6e02c809a4f395a65679185738481d38876a67a | |
parent | 804a4cc1ff9fa159c576be7c685dbb81220c11da (diff) | |
download | scala-9ec6278e05f6acd471473342067e922cb85293d6.tar.gz scala-9ec6278e05f6acd471473342067e922cb85293d6.tar.bz2 scala-9ec6278e05f6acd471473342067e922cb85293d6.zip |
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 dc91d23011..7112edd75d 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -1257,7 +1257,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 + } +} |