mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
parent
268b638a15
commit
09cefc6e71
@ -88,6 +88,10 @@ func (cs *compileState) parseExpr(block *block, fname string, expr ast.Expr, mar
|
||||
return nil, nil, nil, false
|
||||
}
|
||||
stmts = append(stmts, ss...)
|
||||
if len(ts) == 0 {
|
||||
cs.addError(e.Pos(), fmt.Sprintf("unexpected binary operator: %s", e.Y))
|
||||
return nil, nil, nil, false
|
||||
}
|
||||
rhst := ts[0]
|
||||
|
||||
op := e.Op
|
||||
|
@ -4277,7 +4277,7 @@ func Bar() (int, int) {
|
||||
}
|
||||
}
|
||||
|
||||
// Issue #2926
|
||||
// Issue #2926, #2989
|
||||
func TestSyntaxNonTypeExpression(t *testing.T) {
|
||||
if _, err := compileToIR([]byte(`package main
|
||||
|
||||
@ -4306,6 +4306,17 @@ func Bar() float {
|
||||
func Foo() {
|
||||
}
|
||||
|
||||
func Bar() float {
|
||||
return 1.0 + Foo
|
||||
}
|
||||
`)); err == nil {
|
||||
t.Error("compileToIR must return an error but did not")
|
||||
}
|
||||
if _, err := compileToIR([]byte(`package main
|
||||
|
||||
func Foo() {
|
||||
}
|
||||
|
||||
func Bar() float {
|
||||
return Foo.x
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user