mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
parent
75103f39dd
commit
fca8ebb9af
@ -488,6 +488,10 @@ func (cs *compileState) assign(block *block, fname string, pos token.Pos, lhs, r
|
||||
stmts = append(stmts, ss...)
|
||||
|
||||
if define {
|
||||
if _, ok := e.(*ast.Ident); !ok {
|
||||
cs.addError(pos, "non-name on the left side of :=")
|
||||
return nil, false
|
||||
}
|
||||
name := e.(*ast.Ident).Name
|
||||
if name != "_" {
|
||||
for _, v := range block.vars {
|
||||
|
@ -3834,3 +3834,15 @@ func Bar() int {
|
||||
t.Error("compileToIR must return an error but did not")
|
||||
}
|
||||
}
|
||||
|
||||
// Issue #2891
|
||||
func TestSyntaxTailingUnaryOperator(t *testing.T) {
|
||||
if _, err := compileToIR([]byte(`package main
|
||||
|
||||
func Foo() {
|
||||
1 + x := vec2(2)
|
||||
}
|
||||
`)); err == nil {
|
||||
t.Error("compileToIR must return an error but did not")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user