diff options
author | paltherr <paltherr@epfl.ch> | 2004-02-29 14:14:11 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-02-29 14:14:11 +0000 |
commit | 3f86c7c50105aec51d23f7d5a3798b09ac3be504 (patch) | |
tree | 9844bc113b8f5fccdd402f68ec6df14cef702446 /sources | |
parent | a6cbb7ee0f8b75527d1020b020cad2885db8aa26 (diff) | |
download | scala-3f86c7c50105aec51d23f7d5a3798b09ac3be504.tar.gz scala-3f86c7c50105aec51d23f7d5a3798b09ac3be504.tar.bz2 scala-3f86c7c50105aec51d23f7d5a3798b09ac3be504.zip |
- Replaced name tests by symbol tests
Diffstat (limited to 'sources')
-rwxr-xr-x | sources/scala/tools/scaladoc/MLType.scala | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sources/scala/tools/scaladoc/MLType.scala b/sources/scala/tools/scaladoc/MLType.scala index 8e757b378a..60dd03b224 100755 --- a/sources/scala/tools/scaladoc/MLType.scala +++ b/sources/scala/tools/scaladoc/MLType.scala @@ -390,15 +390,21 @@ package scala.tools.scaladoc { /** Test if this type is "scala.Unit". */ def is_scala_Unit(t: Type): boolean = - t.symbol().fullName() == Names.scala_Unit; + t.symbol() == Global.instance.definitions.UNIT_CLASS; /** Test if this type is "scala.Tuple_n[T_1, ..., T_n]". */ - def is_scala_Tuple(t: Type): boolean = - t.symbol().fullName().startsWith(Names.scala_Tuple); + def is_scala_Tuple(t: Type): boolean = { + val tuples = Global.instance.definitions.TUPLE_CLASS; + val arity = t.typeArgs().length; + arity < tuples.length && t.symbol() == tuples(arity); + } /** Test if this type is "scala.Function_n[T_1, ..., T_n, T]". */ - def is_scala_Function(t: Type): boolean = - t.symbol().fullName().startsWith(Names.scala_Function); + def is_scala_Function(t: Type): boolean = { + val functions = Global.instance.definitions.FUNCTION_CLASS; + val arity = t.typeArgs().length - 1; + 0 <= arity && arity < functions.length && t.symbol() == functions(arity); + } /** Test if this type is a local variable */ def is_localVariable(t: Type): boolean = |