mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Revert "shader: Bug fix: Checking unused variables defined with var"
This reverts commit 4d3d3134d5
.
Reason: Test failures
This commit is contained in:
parent
4d3d3134d5
commit
ac971f77c5
@ -322,11 +322,9 @@ func (cs *compileState) parseDecl(b *block, d ast.Decl) ([]shaderir.Stmt, bool)
|
||||
continue
|
||||
}
|
||||
|
||||
for _, v := range vs {
|
||||
b.addNamedLocalVariable(v.name, v.typ, d.Pos())
|
||||
}
|
||||
|
||||
base := b.totalLocalVariableNum()
|
||||
b.vars = append(b.vars, vs...)
|
||||
|
||||
if len(inits) > 0 {
|
||||
for i := range vs {
|
||||
stmts = append(stmts, shaderir.Stmt{
|
||||
|
@ -588,26 +588,6 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
`)); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if _, err := NewShader([]byte(`package main
|
||||
|
||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
var a int
|
||||
return vec4(0)
|
||||
}
|
||||
`)); err == nil {
|
||||
t.Errorf("error must be non-nil but was nil")
|
||||
}
|
||||
|
||||
if _, err := NewShader([]byte(`package main
|
||||
|
||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
var a, b int
|
||||
return vec4(0)
|
||||
}
|
||||
`)); err == nil {
|
||||
t.Errorf("error must be non-nil but was nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestShaderBlankLhs(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user