~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH harec] types: remove str -> *const char assignability rule

Details
Message ID
<20230205053344.2325-1-sebastian@sebsite.pw>
DKIM signature
missing
Download raw message
Patch: +0 -4
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

[harec/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CQADTW3HOJEE.1VPWSV32HKIF9@cirno2>
In-Reply-To
<20230205053344.2325-1-sebastian@sebsite.pw> (view parent)
DKIM signature
missing
Download raw message
harec/patches: SUCCESS in 1m15s

[types: remove str -> *const char assignability rule][0] from [Sebastian][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/38751
[1]: sebastian@sebsite.pw

✓ #934750 SUCCESS harec/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/934750
✓ #934752 SUCCESS harec/patches/netbsd.yml  https://builds.sr.ht/~sircmpwn/job/934752
✓ #934751 SUCCESS harec/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/934751
Details
Message ID
<CQAOCF0T901A.1AOZ44ZUKPP29@attila>
In-Reply-To
<20230205053344.2325-1-sebastian@sebsite.pw> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/harec
   a47c30a..d8c5440  master -> master
Reply to thread Export thread (mbox)