2018-11-13 09:13:53 -07:00
|
|
|
// +build go1.11
|
|
|
|
|
2018-10-29 16:12:41 -06:00
|
|
|
package bad
|
|
|
|
|
2019-07-02 16:10:05 -06:00
|
|
|
func stuff() { //@item(stuff, "stuff", "func()", "func")
|
2018-10-29 16:12:41 -06:00
|
|
|
x := "heeeeyyyy"
|
2019-10-20 17:57:03 -06:00
|
|
|
random2(x) //@diag("x", "compiler", "cannot use x (variable of type string) as int value in argument to random2")
|
2018-11-13 09:13:53 -07:00
|
|
|
random2(1) //@complete("dom", random, random2, random3)
|
2019-10-20 17:57:03 -06:00
|
|
|
y := 3 //@diag("y", "compiler", "y declared but not used")
|
2018-10-29 16:12:41 -06:00
|
|
|
}
|
|
|
|
|
2018-11-13 09:13:53 -07:00
|
|
|
type bob struct { //@item(bob, "bob", "struct{...}", "struct")
|
2018-10-29 16:12:41 -06:00
|
|
|
x int
|
|
|
|
}
|
|
|
|
|
|
|
|
func _() {
|
2018-11-13 09:13:53 -07:00
|
|
|
var q int
|
2018-10-29 16:12:41 -06:00
|
|
|
_ = &bob{
|
2019-10-20 17:57:03 -06:00
|
|
|
f: q, //@diag("f", "compiler", "unknown field f in struct literal")
|
2018-10-29 16:12:41 -06:00
|
|
|
}
|
|
|
|
}
|