Object member values must be unique

This commit is contained in:
Sasha Koshka 2022-10-16 02:41:41 -04:00
parent 098acafab1
commit 85bc6064f2

View File

@ -285,6 +285,16 @@ func (analyzer *analysisOperation) analyzeObjectMembers (
} }
} }
// ensure all member names are unique
for _, compareMember := range into.members {
if compareMember.name == outputMember.name {
err = inputMember.NewError (
"object member names must be unique",
infoerr.ErrorKindError)
return
}
}
into.members = append ( into.members = append (
into.members, into.members,
outputMember) outputMember)