From 023bb034e93363492ef444fefcb1d38cdc61ede1 Mon Sep 17 00:00:00 2001
From: Robert Griesemer T
in a correct program.
-var x interface{} = 7 // x has dynamic type int and value 7 -i := x.(int) // i has type int and value 7 +var x interface{} = 7 // x has dynamic type int and value 7 +i := x.(int) // i has type int and value 7 type I interface { m() } -var y I -s := y.(string) // illegal: string does not implement I (missing method m) -r := y.(io.Reader) // r has type io.Reader and y must implement both I and io.Reader + +func f(y I) { + s := y.(string) // illegal: string does not implement I (missing method m) + r := y.(io.Reader) // r has type io.Reader and the dynamic type of y must implement both I and io.Reader + ⦠+}
-- 2.48.1