diff options
author | Martin Odersky <odersky@gmail.com> | 2013-09-26 12:03:10 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-09-26 12:43:55 +0200 |
commit | 54acd26dcf377e2eb2a474399894e10cfd4322f5 (patch) | |
tree | a275062a8cab9e81b401a4745400f8db71fed1ae /src/dotty/tools/dotc/typer/EtaExpansion.scala | |
parent | b7f5aa30383730dc1d2b34f9773695d0f5669bcd (diff) | |
download | dotty-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/typer/EtaExpansion.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/EtaExpansion.scala | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/EtaExpansion.scala b/src/dotty/tools/dotc/typer/EtaExpansion.scala index 6a2b2060e..155574c81 100644 --- a/src/dotty/tools/dotc/typer/EtaExpansion.scala +++ b/src/dotty/tools/dotc/typer/EtaExpansion.scala @@ -31,11 +31,10 @@ object EtaExpansion { def liftArgs(defs: mutable.ListBuffer[Tree], methType: Type, args: List[Tree])(implicit ctx: Context) = { def toPrefix(name: Name) = if (name contains '$') "" else name.toString - def isByName(tp: Type) = tp.typeSymbol == defn.ByNameParamClass val paramInfos = methType match { case MethodType(paramNames, paramTypes) => (paramNames, paramTypes).zipped map ((name, tp) => - (toPrefix(name), isByName(tp))) + (toPrefix(name), tp isRef defn.ByNameParamClass)) case _ => args map Function.const(("", false)) } |