aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/TreeInfo.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-09-26 12:03:10 +0200
committerMartin Odersky <odersky@gmail.com>2013-09-26 12:43:55 +0200
commit54acd26dcf377e2eb2a474399894e10cfd4322f5 (patch)
treea275062a8cab9e81b401a4745400f8db71fed1ae /src/dotty/tools/dotc/ast/TreeInfo.scala
parentb7f5aa30383730dc1d2b34f9773695d0f5669bcd (diff)
downloaddotty-54acd26dcf377e2eb2a474399894e10cfd4322f5.tar.gz
dotty-54acd26dcf377e2eb2a474399894e10cfd4322f5.tar.bz2
dotty-54acd26dcf377e2eb2a474399894e10cfd4322f5.zip
Added isRef method to determine whether a type is a typeref that refers to a symbol.
The alternative (tpe eq sym.typeConstructor) does not work because types are not unique. The alternative (tpe.typeSymbol == sym) does not work because other types than TypeRefs have typeSymbols.
Diffstat (limited to 'src/dotty/tools/dotc/ast/TreeInfo.scala')
-rw-r--r--src/dotty/tools/dotc/ast/TreeInfo.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/ast/TreeInfo.scala b/src/dotty/tools/dotc/ast/TreeInfo.scala
index adc268943..665fbec89 100644
--- a/src/dotty/tools/dotc/ast/TreeInfo.scala
+++ b/src/dotty/tools/dotc/ast/TreeInfo.scala
@@ -157,7 +157,7 @@ trait TreeInfo[T >: Untyped] { self: Trees.Instance[T] =>
/** Is tpt a by-name parameter type of the form => T? */
def isByNameParamType(tpt: Tree)(implicit ctx: Context) = tpt match {
- case tpt: TypeTree => tpt.typeOpt.typeSymbol == defn.ByNameParamClass
+ case tpt: TypeTree => tpt.typeOpt isRef defn.ByNameParamClass
case AppliedTypeTree(Select(_, tpnme.BYNAME_PARAM_CLASS), _) => true
case _ => false
}