mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
do not create interfaces containing interfaces
R=r DELTA=16 (14 added, 0 deleted, 2 changed) OCL=27464 CL=27466
This commit is contained in:
parent
ff73221d6f
commit
4b8c13dc20
3 changed files with 16 additions and 2 deletions
|
|
@ -310,6 +310,12 @@ func TestInterfaceValue(t *testing.T) {
|
|||
assert(v2.Type().String(), "interface { }");
|
||||
v3 := v2.(reflect.InterfaceValue).Value();
|
||||
assert(v3.Type().String(), "float");
|
||||
|
||||
i3 := v2.Interface();
|
||||
if f, ok := i3.(float); !ok {
|
||||
a, typ, c := sys.Reflect(i3);
|
||||
t.Error("v2.Interface() did not return float, got ", typ);
|
||||
}
|
||||
}
|
||||
|
||||
func TestFunctionValue(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue