You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we are often using the fields and methods properties of a RecordDeclaration to determine certain aspects of a class, e.g.,. its fields or methods. However, the aforementioned fields are actually only designed to hold real AST fields. This poses a problem for languages where parts of the definitions are outside of the class structure or can happen outside the class structure. (e.g., Python or Go). For example, in Go, fields are part of the class AST structure, methods are not. In order to resolve fields, we used to put them into the fields property, even though they are not part of the record class AST.
After #2001 this is finally not needed anymore and we should not do that (see also discussion in #1602). We should only place elements there that are syntactically there - otherwise we get a lot of issues with the EOG and other passes.
However, we still want to be able to query certain aspects of the concept "class", so my suggestion would be to extend the ObjectType (or maybe first introduce a RecordType / ClassType) to include an interface to quickly query all of the fields and methods based on the symbols available in the record's scope.
The text was updated successfully, but these errors were encountered:
Currently, we are often using the
fields
andmethods
properties of aRecordDeclaration
to determine certain aspects of a class, e.g.,. its fields or methods. However, the aforementioned fields are actually only designed to hold real AST fields. This poses a problem for languages where parts of the definitions are outside of the class structure or can happen outside the class structure. (e.g., Python or Go). For example, in Go, fields are part of the class AST structure, methods are not. In order to resolve fields, we used to put them into thefields
property, even though they are not part of the record class AST.After #2001 this is finally not needed anymore and we should not do that (see also discussion in #1602). We should only place elements there that are syntactically there - otherwise we get a lot of issues with the EOG and other passes.
However, we still want to be able to query certain aspects of the concept "class", so my suggestion would be to extend the
ObjectType
(or maybe first introduce aRecordType
/ClassType
) to include an interface to quickly query all of the fields and methods based on the symbols available in the record's scope.The text was updated successfully, but these errors were encountered: