~sircmpwn/hare#701: 
Allocation type detection errors

I'm trying to allocate an array of integer slices. However, the types don't seem to be detected by alloc properly.

I try to immediately return the result of alloc:

fn create_array() *[64][]int = {
	return alloc([[]...]);
};

errors with

Error testalloc.ha:2:15: Return value **[64][]int is not assignable to function result type *[64][]int

If instead I just try to assign to a variable:

fn create_array2() void = {
	let arr: *[64][]int = alloc([[]...]);
};

The compiler errors with

Error testalloc.ha:2:12: Initializer is not assignable to binding type
Status
RESOLVED FIXED
Submitter
~gbear605
Assigned to
No-one
Submitted
2 years ago
Updated
1 year, 4 months ago
Labels
No labels applied.

~sebsite REPORTED FIXED 1 year, 4 months ago

Register here or Log in to comment, or comment via email.