diff options
Diffstat (limited to 'source/slang/type-defs.h')
| -rw-r--r-- | source/slang/type-defs.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/source/slang/type-defs.h b/source/slang/type-defs.h index 34c5b5936..72bf6fe4c 100644 --- a/source/slang/type-defs.h +++ b/source/slang/type-defs.h @@ -492,4 +492,38 @@ protected: virtual int GetHashCode() override; virtual Type* CreateCanonicalType() override; ) -END_SYNTAX_CLASS()
\ No newline at end of file +END_SYNTAX_CLASS() + +// A type created to represent the result of filtering +// the fields of an aggregate type. +SYNTAX_CLASS(FilteredTupleType, Type) +RAW( + struct Element + { + // The original field this element represents + DeclRef<VarDeclBase> fieldDeclRef; + + // The type being used for the new field + RefPtr<Type> type; + }; +) + + FIELD(RefPtr<Type>, originalType); + FIELD(List<Element>, elements); + +RAW( + FilteredTupleType() + {} + + RefPtr<Type> getOriginalType() const { return originalType; } + List<Element> const& getElements() const { return elements; } + virtual String ToString() override; + +protected: + virtual RefPtr<Val> SubstituteImpl(Substitutions* subst, int* ioDiff) override; + virtual bool EqualsImpl(Type * type) override; + virtual int GetHashCode() override; + virtual Type* CreateCanonicalType() override; +) + +END_SYNTAX_CLASS() |
