cx icon indicating copy to clipboard operation
cx copied to clipboard

No compilation error when appending to a pointer to a slice

Open vidya88 opened this issue 5 years ago • 0 comments

@asahi3g commented on Jul 3

To Reproduce

package main

func main()() {
	var si []i32
	var psi *[]i32 = &si
	psi = append(psi, 4)
	panic(true, false, "must not compile")
}

Expected behavior Compilation error eg golang : first argument to append must be slice; have *[]int32 Screenshots

byts1 [1]
byts2 [0]
pending_9.cx: 6: result was not equal to the expected value; must not compile

Desktop:

  • OS: Linux
  • CX Version 0.0.7, commit: f999780

vidya88 avatar Sep 24 '19 02:09 vidya88