keriwarr / orangejoos

JOOS1W Compiler, written in Crystal
0 stars 1 forks source link

additional typing fixes (final) #60

Closed lgo closed 6 years ago

lgo commented 6 years ago

typing: prevent use of void arguments This prevented issues in expression checking for loose checks such as =, which would pass if the LHS and RHS types were equal. This is not allowed for void types.

typing: check field for final modifier before use: arr.length Array.length is intended to behave like a final field, and as such it needs to be checked before permitting an assignment to the field.

typing: check non-static fields for forward decl usage. The rules for using forward declarations are that the field must be part of an assignment earlier in an expression in order to use it.

typing: check access (protected) for methods

add memberdecl backref


brings the tests to 7 remaining. 1 related to fwd declaration in field inits. 5 related to protected access, and one related to (Integer) usage.