Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dyno: Default initializers for classes that inherit (#26028)
This PR changes the frontend to start generating uAST for default initializers, which allows us to support default initializers on classes that inherit. This PR replaces the current signature-based implementation for default initializers with uAST for a Function. This Function's body contains the suitable statements to initialize each field, as well as a "super.init" call if applicable. This code currently lacks suitable init-expressions for default-initializable formals, which is left as future work. An UntypedFnSignature is built manually so that we can force resolution to accept non-existent default values for each formal, regardless of whether it has an init-expression or not. The resulting TypedFnSignature is created with `typedSignatureInitial`. This might be overkill, but it keeps the code cleaner for the time being. ----- Now that default initializers have actual bodies, the frontend is attempting to resolve various assignment operators only defined in the internal/standard modules. This was initially a problem for the dedicated frontend tests, which do not generally load the internal modules in which basic assignment operators are implemented. This PR updates the frontend to generate assignment operators for primitive types, tuples, and classes when the standard library is not available. [reviewed-by @mppf]
- Loading branch information