diff options
| author | Russ Cox <rsc@golang.org> | 2009-02-11 17:55:16 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-02-11 17:55:16 -0800 |
| commit | f6d092aa89daccb517a89abaa9e077a683b57bf1 (patch) | |
| tree | 3a27c60cd93482129d8beda588d769a2d7868d4d /test/ken/interfun.go | |
| parent | d89426aacb706dba5b305bd29d5e7f67927e3848 (diff) | |
| download | golang-f6d092aa89daccb517a89abaa9e077a683b57bf1.tar.gz | |
insert type assertions when narrowing.
R=r
OCL=24349
CL=24913
Diffstat (limited to 'test/ken/interfun.go')
| -rw-r--r-- | test/ken/interfun.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ken/interfun.go b/test/ken/interfun.go index 97db89316..876d94128 100644 --- a/test/ken/interfun.go +++ b/test/ken/interfun.go @@ -49,16 +49,16 @@ main() if s.g() != 6 { panic(12); } i1 = s; // convert S to I1 - i2 = i1; // convert I1 to I2 + i2 = i1.(I2); // convert I1 to I2 // call interface if i1.f() != 5 { panic(21); } if i2.f() != 5 { panic(22); } if i2.g() != 6 { panic(23); } - g = i1; // convert I1 to S + g = i1.(*S); // convert I1 to S if g != s { panic(31); } - g = i2; // convert I2 to S + g = i2.(*S); // convert I2 to S if g != s { panic(32); } } |
