Skip to content

Commit

Permalink
TestErrMapLit
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Feb 19, 2024
1 parent da1265b commit a0bf538
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cl/error_msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,11 @@ b := []int{2: a}
}

func TestErrMapLit(t *testing.T) {
codeErrorTest(t, `bar.gop:4:6: cannot use 1 (type untyped int) as type string in map key`, `
func foo(map[string]string) {}
foo {1: 2}
`)
codeErrorTest(t, `bar.gop:2:1: invalid composite literal type int`, `
int{2}
`)
Expand Down

0 comments on commit a0bf538

Please sign in to comment.