Commit f10a7882 authored by Russ Cox's avatar Russ Cox

gc: another pointer to interface message

R=ken2
CC=golang-dev
https://golang.org/cl/4444056
parent 5ff33364
......@@ -1928,13 +1928,14 @@ assignop(Type *src, Type *dst, char **why)
}
return 0;
}
if(isptrto(dst, TINTER)) {
if(why != nil)
*why = smprint(":\n\t%T is pointer to interface, not interface", dst);
return 0;
}
if(src->etype == TINTER && dst->etype != TBLANK) {
if(why != nil) {
if(isptrto(dst, TINTER))
*why = smprint(":\n\t%T is interface, not pointer to interface", src);
else
*why = ": need type assertion";
}
if(why != nil)
*why = ": need type assertion";
return 0;
}
......
......@@ -33,4 +33,5 @@ func main() {
print("call addinst\n")
var x Inst = AddInst(new(Start)) // ERROR "pointer to interface"
print("return from addinst\n")
var x *Inst = new(Start) // ERROR "pointer to interface"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment