diff options
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
| -rw-r--r-- | source/slang/slang-ast-type.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index bcaf8f5a9..5ee0c5c70 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -148,6 +148,27 @@ HashCode ErrorType::_getHashCodeOverride() return HashCode(size_t(this)); } +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! BottomType !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +void BottomType::_toTextOverride(StringBuilder& out) { out << toSlice("never"); } + +bool BottomType::_equalsImplOverride(Type* type) +{ + if (auto bottomType = as<BottomType>(type)) + return true; + return false; +} + +Type* BottomType::_createCanonicalTypeOverride() { return this; } + +Val* BottomType::_substituteImplOverride( + ASTBuilder* /* astBuilder */, SubstitutionSet /*subst*/, int* /*ioDiff*/) +{ + return this; +} + +HashCode BottomType::_getHashCodeOverride() { return HashCode(size_t(this)); } + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DeclRefType !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! void DeclRefType::_toTextOverride(StringBuilder& out) @@ -550,7 +571,7 @@ void FuncType::_toTextOverride(StringBuilder& out) } out << toSlice(") -> ") << getResultType(); - if (!getErrorType()->equals(getASTBuilder()->getVoidType())) + if (!getErrorType()->equals(getASTBuilder()->getBottomType())) { out << " throws " << getErrorType(); } |
