| 1 |
// Copyright 2019 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package ssa |
| 6 |
|
| 7 |
type T struct{} |
| 8 |
|
| 9 |
func (T) foo() {} |
| 10 |
|
| 11 |
type fooer interface { |
| 12 |
foo() |
| 13 |
} |
| 14 |
|
| 15 |
func Works(v interface{}) { |
| 16 |
switch v.(type) { |
| 17 |
case interface{}: |
| 18 |
v.(fooer).foo() |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
func Panics(v interface{}) { |
| 23 |
switch v.(type) { |
| 24 |
case interface{}: |
| 25 |
v.(fooer).foo() |
| 26 |
v.(interface{ foo() }).foo() |
| 27 |
} |
| 28 |
} |