Member analysis stub

This commit is contained in:
Sasha Koshka 2022-10-12 13:05:19 -04:00
parent 83fbd38c75
commit d4146ac6ce
1 changed files with 18 additions and 1 deletions

View File

@ -123,7 +123,24 @@ func (analyzer analysisOperation) analyzeTypeSection () (
if err != nil { return }
}
// TODO: analyze members
// analyze members
isObj := outputSection.what.underlyingPrimitive() == &PrimitiveObj
if isObj {
// use the Member method on the inherited type to type check and
// permission check default value overrides.
for index := 0; index < inputSection.MembersLength(); index ++ {
// inputMember := inputSection.Member(index)
// TODO
}
} else if inputSection.MembersLength() > 0 {
// if there are members, and the inherited type does not have
// Obj as a primitive, throw an error.
err = inputSection.Member(0).NewError (
"members can only be defined on types descending " +
"from Obj",
infoerr.ErrorKindError)
}
outputSection.complete = true
return