-
Notifications
You must be signed in to change notification settings - Fork 562
Open
Milestone
Description
In XGo classfile T, the following code
var (
name1 V1
name2 V2
)would be converted to:
type T struct {
name1 V1
name2 V2
}And in previous versions of XGo, the following code
var (
name1 V1
)
var (
name2 V2
)would be converted to:
type T struct {
name1 V1
}
var (
name2 V2
)To avoid inconsistencies in the behavior of the first var block and other var blocks, we decide to prohibit defining multiple normal var blocks in the classfile.
If you need to define global variables in the classfile, you need to use static members:
var (
name1 V1 // class member
)
var (
.name2 V2 // static variable
)