stringref icon indicating copy to clipboard operation
stringref copied to clipboard

`string.new*`, `string.const`, `string.concat` should produce non-nullable results

Open jakobkummerow opened this issue 2 years ago • 6 comments

Currently, the spec text for the various string creating instructions says that the result has type stringref, e.g.:

(string.new_wtf8 $memory $wtf8_policy ptr:address bytes:i32)
  -> str:stringref

(string.concat a:stringref b:stringref) -> stringref

With stringref being nullable (contrary to initial assumptions?), that doesn't make a whole lot of sense: I think the result type should be a non-nullable (ref string) instead. (This would be similar to e.g. struct.new $t, which also returns a non-nullable (ref $t).)

jakobkummerow avatar Aug 24 '22 19:08 jakobkummerow