diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-26 11:51:42 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-26 11:51:42 +0200 |
commit | 001132d842f0d1962a0264307610aa805de4d338 (patch) | |
tree | 7ad908d0bb756c1861153fa999a74015d29f6e5f /test/files | |
parent | bda48577d022811be58ce2b7f9e46890543ad45b (diff) | |
download | scala-001132d842f0d1962a0264307610aa805de4d338.tar.gz scala-001132d842f0d1962a0264307610aa805de4d338.tar.bz2 scala-001132d842f0d1962a0264307610aa805de4d338.zip |
SI-7876 Scaladoc crasher due to regression in isFunctionType.
`isFunctionType` and `isTupleType` started returing true for
type constructors as of aeb73314. This led to a crash in type
printing in ScalaDoc (specfically, in ModelFactoryTypeSupport.scala)
This commit:
- fixes those methods by guarding with !isHigherKinded
- unit tests said methods
- tests the reported crasher with a ScalaDoc test.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t7876.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/run/t7876.scala b/test/files/run/t7876.scala new file mode 100644 index 0000000000..aeec8c8cce --- /dev/null +++ b/test/files/run/t7876.scala @@ -0,0 +1,26 @@ +import scala.tools.partest._ + +// Type constructors for FunctionN and TupleN should not be considered as function type / tuple types. +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp" + + def code = "" + + def show() { + val global = newCompiler() + new global.Run() + import global._, definitions._ + val function0TC = FunctionClass(0).typeConstructor + val tuple1TC = TupleClass(1).typeConstructor + FunctionClass.seq.foreach { sym => + val tc = sym.typeConstructor + assert(!isFunctionType(tc), s"$tc") + assert(!isFunctionTypeDirect(tc), s"$tc (direct)") + } + TupleClass.seq.foreach { sym => + val tc = sym.typeConstructor + assert(!isTupleType(tc), s"$sym") + assert(!isTupleTypeDirect(tc), s"$tc (direct)") + } + } +} |