Skip to content

[TS] Handle constructors in the list of methods #319

@Lipen

Description

@Lipen

We need to carefully handle the presence of the constructor in the list of methods (EtsClass::methods).

  • If we receive the IR (from AA) where methods contain a non-empty constructor, we are good.
  • If there is no explicit constructor in the TS class, AA will create --- in the most cases --- an empty one (on their side, it is also marked as "synthetic"), and we will receive it via IR.
  • However, sometimes there is no constructor among methods in the IR. We handle this inside EtsClass::ctor by searching for the method called constructor among the methods, and if there is no such method, we return (in val ctor) a newly (lazily cached) created one. Probably we should consider adding this newly created ctor in methods list. Or better just ensure that methods list contains the constructor (or put a synthetic one) during the initialization of EtsClassImpl.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions