cx
cx copied to clipboard
Compilation error when using inline initalization of a slice var as function argument.
@asahi3g commented on Jul 3
To Reproduce
package main
func fooi(slice []i32) {
test(len(slice), 3, "")
test(slice[0], 1, "")
test(slice[1], 2, "")
test(slice[2], 3, "")
}
func foos(slice []str) {
test(len(slice), 3, "")
test(slice[0], "foo", "")
test(slice[1], "slice", "")
test(slice[2], "str", "")
}
func main()() {
fooi([]i32{1, 2, 3})
foos([]str {"foo", "slice", "str"})
}
Expected behavior No compilation error.
Screenshots
error: pending_0.cx:18 identifier '*lcl_2' does not exist
error: pending_0.cx:18 identifier '*lcl_2' does not exist
error: pending_0.cx:18 identifier '*lcl_2' does not exist
error: pending_0.cx:18 identifier '*lcl_2' does not exist
error: pending_0.cx:18 identifier '*lcl_2' does not exist
error: pending_0.cx:18 identifier '*lcl_2' does not exist
error: pending_0.cx:18 identifier '*lcl_2' does not exist
error: pending_0.cx:19 identifier '*lcl_4' does not exist
error: pending_0.cx:19 identifier '*lcl_4' does not exist
error: pending_0.cx:19 identifier '*lcl_4' does not exist
error: pending_0.cx:19 identifier '*lcl_4' does not exist
error: pending_0.cx:19 identifier '*lcl_4' does not exist
error: pending_0.cx:19 identifier '*lcl_4' does not exist
error: pending_0.cx:19 identifier '*lcl_4' does not exist
Desktop:
- OS: Linux
- CX Version 0.7.0, commit : f999780