mirror of
https://github.com/golang/go
synced 2024-11-22 01:44:40 -07:00
gc: another pointer to interface message
R=ken2 CC=golang-dev https://golang.org/cl/4444056
This commit is contained in:
parent
5ff3336490
commit
f10a7882c6
@ -1928,13 +1928,14 @@ assignop(Type *src, Type *dst, char **why)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(src->etype == TINTER && dst->etype != TBLANK) {
|
if(isptrto(dst, TINTER)) {
|
||||||
if(why != nil) {
|
if(why != nil)
|
||||||
if(isptrto(dst, TINTER))
|
*why = smprint(":\n\t%T is pointer to interface, not interface", dst);
|
||||||
*why = smprint(":\n\t%T is interface, not pointer to interface", src);
|
return 0;
|
||||||
else
|
|
||||||
*why = ": need type assertion";
|
|
||||||
}
|
}
|
||||||
|
if(src->etype == TINTER && dst->etype != TBLANK) {
|
||||||
|
if(why != nil)
|
||||||
|
*why = ": need type assertion";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,4 +33,5 @@ func main() {
|
|||||||
print("call addinst\n")
|
print("call addinst\n")
|
||||||
var x Inst = AddInst(new(Start)) // ERROR "pointer to interface"
|
var x Inst = AddInst(new(Start)) // ERROR "pointer to interface"
|
||||||
print("return from addinst\n")
|
print("return from addinst\n")
|
||||||
|
var x *Inst = new(Start) // ERROR "pointer to interface"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user