You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
A pointer of an Objective-C class can't be assigned to a variable as a pointer of
another Objective-C class. For example:
package main
// #cgo CFLAGS: -x objective-c
//
// @class Foo;
// @class Bar;
import "C"
func main() {
var foo *C.Foo
var bar *C.Bar
foo = bar // ?
print(foo)
print(bar)
}
What is the expected output?
Compile Error
What do you see instead?
Compile succeeded
("0x00x0" was printed)
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Mac OS X 10.9
Which version are you using? (run 'go version')
go version go1.2 darwin/amd64
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
For what it's worth, Go 1.3 on linux/amd64 using either CC=gcc or CC=clang, C.Foo and
C.Bar are now rewritten as _Ctype_struct_Foo and _Ctype_struct_Bar, which are both
defined as "struct{}". So the Go compiler now rejects the "foo = bar" assignment
because "*_Ctype_struct_Foo" and "*_Ctype_struct_Bar" are distinct types.
Thus I think the "expected output" from the issue report is now satisfied, though it
might be worthwhile if someone could verify on OS X too.
The text was updated successfully, but these errors were encountered: