diff options
author | Martin Odersky <odersky@gmail.com> | 2013-11-25 15:11:40 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-11-25 17:33:07 +0100 |
commit | 42ee73f47e17f6e1c028444d3b144c9a9c8cf561 (patch) | |
tree | 83e8150f42985d8600b26f44c251a28d8d621a8c /src/dotty/tools/dotc/core/Types.overflow | |
parent | 510ae8bf1c6932595c1313c4b7a8027c435640be (diff) | |
download | dotty-42ee73f47e17f6e1c028444d3b144c9a9c8cf561.tar.gz dotty-42ee73f47e17f6e1c028444d3b144c9a9c8cf561.tar.bz2 dotty-42ee73f47e17f6e1c028444d3b144c9a9c8cf561.zip |
More Types polishings
In paricular, now type accumulators include the prefix of a ClassInfo type.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.overflow')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.overflow | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Types.overflow b/src/dotty/tools/dotc/core/Types.overflow index 0474bc229..77f1f6fc1 100644 --- a/src/dotty/tools/dotc/core/Types.overflow +++ b/src/dotty/tools/dotc/core/Types.overflow @@ -32,4 +32,35 @@ object Types { } + + class AndType extends Type { + + def derived_& (tp1: Type, tp2: Type)(implicit ctx: Context) = + if ((tp1 eq this.tp1) && (tp2 eq this.tp2)) this + else tp1 & tp2 + + } + + class OrType extends Type { + + def derived_| (tp1: Type, tp2: Type)(implicit ctx: Context) = + if ((tp1 eq this.tp1) && (tp2 eq this.tp2)) this + else tp1 | tp2 + + } + + class MethodType { + /* probably won't be needed + private var _isVarArgs: Boolean = _ + private var knownVarArgs: Boolean = false + + def isVarArgs(implicit ctx: Context) = { + if (!knownVarArgs) { + _isVarArgs = paramTypes.nonEmpty && paramTypes.last.isRepeatedParam + knownVarArgs = true + } + _isVarArgs + } + */ + } }
\ No newline at end of file |