What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
126 Pointed out there are a handful of cases specifically in the FlightControls class of KOS that are only settable. As part of this PR some reworking was done to how types are checked for the appropriate access. This fixes #126
What is the current behavior? (You can also link to an open issue here)
The current behavior is not well documented or tested as it mostly ad hoc implementation that worked sometimes (poorly).
What is the new behavior (if this is a feature change)?
The new behavior follows roughly this procedure for the provided example expression.
local x is ship:body:patches:sublist(0, 10):join(",")[10].
// ^ ^ ^ ^ ^ ^
// \-----|------|-------|------------|--------|--- Look type using symbol table to get tracker
// \------|-------|------------|--------|--- Check for "body" suffix on type "vesselTarget" return suffix "getter"
// \-------|------------|--------|--- Get assignment type of "body" check for "patches" on "bodyTarget" return suffix "getter"
// \------------|--------|--- Get assignment type of "patches" check for "sublist" on "vector" return suffix "method"
// \--------|--- Get assignment type of "sublist" check for "join" on "vector" return suffix "method"
// \ --- Get assignment type of "join" check if indexer exists and return
//
// during assignment we get assignment type of the final indexer and assign to x
The internal nodes of an expression now individual check for getter, until the final node in the example the indexer. In the statement we then check the resulting expression has the correct access or call signature needed.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
126 Pointed out there are a handful of cases specifically in the
FlightControls
class of KOS that are only settable. As part of this PR some reworking was done to how types are checked for the appropriate access. This fixes #126What is the current behavior? (You can also link to an open issue here) The current behavior is not well documented or tested as it mostly ad hoc implementation that worked sometimes (poorly).
What is the new behavior (if this is a feature change)? The new behavior follows roughly this procedure for the provided example expression.
The internal nodes of an expression now individual check for getter, until the final node in the example the indexer. In the statement we then check the resulting expression has the correct access or call signature needed.