diff options
Diffstat (limited to 'test/interface/assertinline.go')
| -rw-r--r-- | test/interface/assertinline.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/interface/assertinline.go b/test/interface/assertinline.go index 227fe70d87..c3f3624570 100644 --- a/test/interface/assertinline.go +++ b/test/interface/assertinline.go @@ -43,7 +43,7 @@ func assertbig(x interface{}) complex128 { } func assertbig2(x interface{}) (complex128, bool) { - z, ok := x.(complex128) // ERROR "type assertion not inlined" + z, ok := x.(complex128) // ERROR "type assertion .scalar result. inlined" return z, ok } @@ -51,3 +51,17 @@ func assertbig2ok(x interface{}) (complex128, bool) { _, ok := x.(complex128) // ERROR "type assertion [(]ok only[)] inlined" return 0, ok } + +func assertslice(x interface{}) []int { + return x.([]int) // ERROR "type assertion not inlined" +} + +func assertslice2(x interface{}) ([]int, bool) { + z, ok := x.([]int) // ERROR "type assertion not inlined" + return z, ok +} + +func assertslice2ok(x interface{}) ([]int, bool) { + _, ok := x.([]int) // ERROR "type assertion [(]ok only[)] inlined" + return nil, ok +} |
