From d4146ac6ce7e5d5be7aad84499e9b55e4069d2e4 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 12 Oct 2022 13:05:19 -0400 Subject: [PATCH] Member analysis stub --- analyzer/type-section.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/analyzer/type-section.go b/analyzer/type-section.go index 969a843..9e0c5d1 100644 --- a/analyzer/type-section.go +++ b/analyzer/type-section.go @@ -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