Fix parameters below the pass-by-reference size threshold not being
passed by reference when the procedure returns a non-direct view,
resulting in access violations at run-time when trying to access the
returned view.
Details
consider immutable non-direct views (e.g., object types with lent
fields) when deciding whether pass-by-reference is used for the first
parameter of a procedure
move the classifyViewType procedures from typeallowed to types,
as they're wholly unrelated to the "type allowed" checks
Summary
Fix parameters below the pass-by-reference size threshold not being passed by reference when the procedure returns a non-direct view, resulting in access violations at run-time when trying to access the returned view.
Details
object
types withlent
fields) when deciding whether pass-by-reference is used for the first parameter of a procedureclassifyViewType
procedures fromtypeallowed
totypes
, as they're wholly unrelated to the "type allowed" checksFixes https://github.com/nim-works/nimskull/issues/1457.