mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-06 13:07:59 +00:00
Remove some dead code
This commit is contained in:
@@ -48,7 +48,7 @@ BuiltinTypeIsProc *builtin_type_is_procs[BuiltinProc__type_simple_boolean_end -
|
||||
};
|
||||
|
||||
|
||||
void check_try_split_types(CheckerContext *c, Operand *x, String const &name, Type **left_type_, Type **right_type_) {
|
||||
void check_or_else_split_types(CheckerContext *c, Operand *x, String const &name, Type **left_type_, Type **right_type_) {
|
||||
Type *left_type = nullptr;
|
||||
Type *right_type = nullptr;
|
||||
if (x->type->kind == Type_Tuple) {
|
||||
@@ -75,11 +75,6 @@ void check_try_split_types(CheckerContext *c, Operand *x, String const &name, Ty
|
||||
error(x->expr, "'%.*s' expects an \"optional ok\" like value, got %s", LIT(name), str);
|
||||
gb_string_free(str);
|
||||
}
|
||||
// if (!type_has_nil(right_type) && !is_type_boolean(right_type)) {
|
||||
// gbString str = type_to_string(right_type);
|
||||
// error(x->expr, "'%.*s' expects an \"optional ok\" like value, or an n-valued expression where the last value is either a boolean or can be compared against 'nil', got %s", LIT(name), str);
|
||||
// gb_string_free(str);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -1829,7 +1824,7 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
|
||||
|
||||
Type *left_type = nullptr;
|
||||
Type *right_type = nullptr;
|
||||
check_try_split_types(c, &x, builtin_name, &left_type, &right_type);
|
||||
check_or_else_split_types(c, &x, builtin_name, &left_type, &right_type);
|
||||
add_type_and_value(&c->checker->info, arg, x.mode, x.type, x.value);
|
||||
|
||||
if (left_type != nullptr) {
|
||||
|
||||
@@ -662,23 +662,10 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
|
||||
if (expr->kind == Ast_AutoCast) {
|
||||
Operand x = *operand;
|
||||
x.expr = expr->AutoCast.expr;
|
||||
bool ok = check_cast_internal(c, &x, type);
|
||||
if (ok) {
|
||||
if (check_cast_internal(c, &x, type)) {
|
||||
return MAXIMUM_TYPE_DISTANCE;
|
||||
}
|
||||
} /*else if (expr->kind == Ast_CallExpr) {
|
||||
// NOTE(bill, 2021-04-19): Allow assignment of procedure calls with #optional_ok
|
||||
ast_node(ce, CallExpr, expr);
|
||||
Type *pt = base_type(type_of_expr(ce->proc));
|
||||
if (pt->kind == Type_Proc && pt->Proc.optional_ok) {
|
||||
Operand x = *operand;
|
||||
x.type = pt->Proc.results->Tuple.variables[0]->type;
|
||||
i64 res = check_distance_between_types(c, &x, type);
|
||||
if (res >= 0) {
|
||||
return res+1;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
@@ -277,10 +277,11 @@ enum FieldFlag : u32 {
|
||||
FieldFlag_const = 1<<5,
|
||||
FieldFlag_any_int = 1<<6,
|
||||
|
||||
FieldFlag_Tags = 1<<10,
|
||||
|
||||
// Internal use by the parser only
|
||||
FieldFlag_Tags = 1<<10,
|
||||
FieldFlag_Results = 1<<16,
|
||||
|
||||
// Parameter List Restrictions
|
||||
FieldFlag_Signature = FieldFlag_ellipsis|FieldFlag_using|FieldFlag_no_alias|FieldFlag_c_vararg|FieldFlag_auto_cast|FieldFlag_const|FieldFlag_any_int,
|
||||
FieldFlag_Struct = FieldFlag_using|FieldFlag_Tags,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user