diff options
| author | gingerBill <bill@gingerbill.org> | 2022-03-19 13:03:08 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-03-19 13:03:08 +0000 |
| commit | 16bd6c7205a1eea264cc2daa077f4c7f096868af (patch) | |
| tree | b2ac4038bec2d8f1430a7b3b7f0d1a4bd104b098 /src/check_expr.cpp | |
| parent | 714a5e8931c6113807077dd1653a94437b267708 (diff) | |
Mock out instructions emit calls
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 577f3b07c..937995df3 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -119,6 +119,7 @@ void check_or_else_split_types(CheckerContext *c, Operand *x, String const &name void check_or_else_expr_no_value_error(CheckerContext *c, String const &name, Operand const &x, Type *type_hint); void check_or_return_split_types(CheckerContext *c, Operand *x, String const &name, Type **left_type_, Type **right_type_); +bool check_is_castable_to(CheckerContext *c, Operand *operand, Type *y); void check_did_you_mean_print(DidYouMeanAnswers *d, char const *prefix = "") { auto results = did_you_mean_results(d); @@ -850,6 +851,14 @@ bool internal_check_is_assignable_to(Type *src, Type *dst) { return check_is_assignable_to(nullptr, &x, dst); } +bool internal_check_is_castable_to(Type *src, Type *dst) { + Operand x = {}; + x.type = src; + x.mode = Addressing_Value; + return check_is_castable_to(nullptr, &x, dst); +} + + AstPackage *get_package_of_type(Type *type) { for (;;) { if (type == nullptr) { |