diff options
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 |