From 001132d842f0d1962a0264307610aa805de4d338 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 26 Sep 2013 11:51:42 +0200 Subject: 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. --- test/files/run/t7876.scala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/files/run/t7876.scala (limited to 'test/files') 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)") + } + } +} -- cgit v1.2.3