-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TyTy: TyTy improved subclass casting and checking
Associate each subclass with its kind and create cast/match+cast methods. gcc/rust/ChangeLog: * typecheck/rust-tyty.cc (InferType::InferType): Use static constant for kind information. (ErrorType::ErrorType): Use static constant for kind information. (TupleType::TupleType): Use static constant for kind information. (BoolType::BoolType): Use static constant for kind information. (IntType::IntType): Use static constant for kind information. (UintType::UintType): Use static constant for kind information. (FloatType::FloatType): Use static constant for kind information. (USizeType::USizeType): Use static constant for kind information. (ISizeType::ISizeType): Use static constant for kind information. (CharType::CharType): Use static constant for kind information. (ReferenceType::ReferenceType): Use static constant for kind information. (PointerType::PointerType): Use static constant for kind information. (ParamType::ParamType): Use static constant for kind information. (StrType::StrType): Use static constant for kind information. (NeverType::NeverType): Use static constant for kind information. (PlaceholderType::PlaceholderType): Use static constant for kind information. * typecheck/rust-tyty.h: Add static kind information to all TyTy classes. Create safe cast and check methods. Signed-off-by: Jakub Dupak <[email protected]>
- Loading branch information
Showing
2 changed files
with
154 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.