aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-16 12:06:03 +0000
committergingerBill <bill@gingerbill.org>2023-01-16 12:06:03 +0000
commit2dca39b55716d84e760d3a33b9754c18d7f6f1cc (patch)
tree685a8a85f7c023cff913d29e49ecff6e6a551380 /src/check_type.cpp
parentb55fa268bf156ff72551868d84f45b579e2025b2 (diff)
Remove `auto_cast` procedure field flag
Fixes #2285
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 0bd9af15f..ad746514e 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -1619,10 +1619,6 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
}
}
- if (p->flags&FieldFlag_auto_cast) {
- error(name, "'auto_cast' can only be applied to variable fields");
- p->flags &= ~FieldFlag_auto_cast;
- }
if (p->flags&FieldFlag_const) {
error(name, "'#const' can only be applied to variable fields");
p->flags &= ~FieldFlag_const;
@@ -1681,11 +1677,7 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
}
if (type != t_invalid && !check_is_assignable_to(ctx, &op, type)) {
bool ok = true;
- if (p->flags&FieldFlag_auto_cast) {
- if (!check_is_castable_to(ctx, &op, type)) {
- ok = false;
- }
- } else if (p->flags&FieldFlag_any_int) {
+ if (p->flags&FieldFlag_any_int) {
if ((!is_type_integer(op.type) && !is_type_enum(op.type)) || (!is_type_integer(type) && !is_type_enum(type))) {
ok = false;
} else if (!check_is_castable_to(ctx, &op, type)) {
@@ -1731,10 +1723,6 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
error(name, "'#no_alias' can only be applied to non constant values");
p->flags &= ~FieldFlag_no_alias; // Remove the flag
}
- if (p->flags&FieldFlag_auto_cast) {
- error(name, "'auto_cast' can only be applied to variable fields");
- p->flags &= ~FieldFlag_auto_cast;
- }
if (p->flags&FieldFlag_any_int) {
error(name, "'#any_int' can only be applied to variable fields");
p->flags &= ~FieldFlag_any_int;
@@ -1765,9 +1753,6 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
if (p->flags&FieldFlag_no_alias) {
param->flags |= EntityFlag_NoAlias;
}
- if (p->flags&FieldFlag_auto_cast) {
- param->flags |= EntityFlag_AutoCast;
- }
if (p->flags&FieldFlag_any_int) {
if (!is_type_integer(param->type) && !is_type_enum(param->type)) {
gbString str = type_to_string(param->type);