11
_test/const25.go
Normal file
11
_test/const25.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
const (
|
||||||
|
FGBlack Attribute = iota + 30
|
||||||
|
)
|
||||||
|
|
||||||
|
type Attribute int
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
println(FGBlack)
|
||||||
|
}
|
||||||
@@ -82,8 +82,15 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) {
|
|||||||
i--
|
i--
|
||||||
}
|
}
|
||||||
dest := a.child[i]
|
dest := a.child[i]
|
||||||
if dest.typ != nil && !isInterface(dest.typ) {
|
if dest.typ == nil {
|
||||||
// Interface type are not propagated, and will be resolved at post-order.
|
break
|
||||||
|
}
|
||||||
|
if dest.typ.incomplete {
|
||||||
|
err = n.cfgErrorf("invalid type declaration")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if !isInterface(dest.typ) {
|
||||||
|
// Interface types are not propagated, and will be resolved at post-order.
|
||||||
n.typ = dest.typ
|
n.typ = dest.typ
|
||||||
}
|
}
|
||||||
case binaryExpr, unaryExpr, parenExpr:
|
case binaryExpr, unaryExpr, parenExpr:
|
||||||
|
|||||||
Reference in New Issue
Block a user