This was broken, and other suitable workarounds already exist (e.g.
constchar function in harec rt), so this isn't really worth it.
Signed-off-by: Sebastian <sebastian@sebsite.pw>
---
src/types.c | 3 ---
tests/05-implicit-casts.ha | 1 -
2 files changed, 4 deletions(-)
diff --git a/src/types.c b/src/types.c
index ea08561..7411f7e 100644
--- a/src/types.c
+++ b/src/types.c
@@ -817,9 +817,6 @@ type_is_assignable(const struct type *to, const struct type *from)
return to->pointer.flags & PTR_NULLABLE;
}
return true;
- case STORAGE_STRING:
- return to->pointer.referent->storage == STORAGE_CHAR
- && to->pointer.referent->flags & TYPE_CONST;
default:
return false;
}
diff --git a/tests/05-implicit-casts.ha b/tests/05-implicit-casts.ha
index e633f29..393c275 100644
--- a/tests/05-implicit-casts.ha
+++ b/tests/05-implicit-casts.ha
@@ -76,7 +76,6 @@ fn rules() void = {
assert(compile("fn test() void = { let _u32: u32 = 42u64; };") as exited != EXIT_SUCCESS);
// Pointer conversions
- let cchr: *const char = "hello world";
let nptr: nullable *int = null;
nptr = &i;
let vptr: nullable *void = nptr;
--
2.38.1