aboutsummaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-10-04 13:21:56 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-10-04 13:21:56 -0400
commit6b9055db7c03c09654c0605b96a37d50bf563fa9 (patch)
treeca6ee66251fe1ba0beceff21bca52be2953b0573 /types.c
parent8f346b48aa49ac0590c9c77edb75c63560398e1a (diff)
Deprecate readonly pointers for now
Diffstat (limited to 'types.c')
-rw-r--r--types.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/types.c b/types.c
index b1ca4bd7..17009f9e 100644
--- a/types.c
+++ b/types.c
@@ -69,7 +69,6 @@ CORD type_to_cord(type_t *t) {
case PointerType: {
auto ptr = Match(t, PointerType);
CORD sigil = ptr->is_stack ? "&" : "@";
- if (ptr->is_readonly) sigil = CORD_cat(sigil, "%");
return CORD_all(sigil, type_to_cord(ptr->pointed));
}
case EnumType: {
@@ -350,9 +349,6 @@ PUREFUNC bool can_promote(type_t *actual, type_t *needed)
else if (actual_ptr->is_stack && !needed_ptr->is_stack)
// Can't use &x for a function that wants a @Foo or ?Foo
return false;
- else if (actual_ptr->is_readonly && !needed_ptr->is_readonly)
- // Can't use pointer to readonly data when we need a pointer that can write to the data
- return false;
else
return true;
}