2018-11-13 09:13:53 -07:00
|
|
|
// +build go1.11
|
|
|
|
|
2018-10-29 16:12:41 -06:00
|
|
|
package bad
|
|
|
|
|
2018-11-13 09:13:53 -07:00
|
|
|
func stuff() { //@item(stuff, "stuff()", "", "func")
|
2018-10-29 16:12:41 -06:00
|
|
|
x := "heeeeyyyy"
|
2019-02-06 09:24:10 -07:00
|
|
|
random2(x) //@diag("x", "LSP", "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-02-06 09:24:10 -07:00
|
|
|
y := 3 //@diag("y", "LSP", "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-02-06 09:24:10 -07:00
|
|
|
f: q, //@diag("f", "LSP", "unknown field f in struct literal")
|
2018-10-29 16:12:41 -06:00
|
|
|
}
|
|
|
|
}
|