php8: do not resolve reserved name mixed
in NamespaceResolver
This commit is contained in:
parent
6855357aaa
commit
9281143091
@ -370,6 +370,8 @@ func (ns *Namespace) ResolveName(nameNode ast.Vertex, aliasType string) (string,
|
|||||||
case "iterable":
|
case "iterable":
|
||||||
fallthrough
|
fallthrough
|
||||||
case "object":
|
case "object":
|
||||||
|
fallthrough
|
||||||
|
case "mixed": // 8.0
|
||||||
return part, nil
|
return part, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -855,6 +855,12 @@ func TestDoNotResolveReservedNames(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nameMixed := &ast.Name{
|
||||||
|
Parts: []ast.Vertex{
|
||||||
|
&ast.NamePart{Value: []byte("mixed")},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
function := &ast.StmtFunction{
|
function := &ast.StmtFunction{
|
||||||
Name: &ast.Identifier{Value: []byte("bar")},
|
Name: &ast.Identifier{Value: []byte("bar")},
|
||||||
Params: []ast.Vertex{
|
Params: []ast.Vertex{
|
||||||
@ -900,6 +906,12 @@ func TestDoNotResolveReservedNames(t *testing.T) {
|
|||||||
Name: &ast.Identifier{Value: []byte("Object")},
|
Name: &ast.Identifier{Value: []byte("Object")},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
&ast.Parameter{
|
||||||
|
Type: nameMixed,
|
||||||
|
Var: &ast.ExprVariable{
|
||||||
|
Name: &ast.Identifier{Value: []byte("Mixed")},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -925,6 +937,7 @@ func TestDoNotResolveReservedNames(t *testing.T) {
|
|||||||
nameVoid: "void",
|
nameVoid: "void",
|
||||||
nameIterable: "iterable",
|
nameIterable: "iterable",
|
||||||
nameObject: "object",
|
nameObject: "object",
|
||||||
|
nameMixed: "mixed",
|
||||||
}
|
}
|
||||||
|
|
||||||
nsResolver := nsresolver.NewNamespaceResolver()
|
nsResolver := nsresolver.NewNamespaceResolver()
|
||||||
|
Loading…
Reference in New Issue
Block a user