MC
Metalama CommunityAndreu
Override constructor
Is it possible to override a constructor?
I want to take my code:
and translate it to:
In the example, I add a private field
age
, but if it's not possible it's ok, I'll be happy with just overriding the constructorGael Fraiteur•311d ago
You cannot litterally override a constructor, however you can add statements at the beginning of it, so your use case can be covered. This is called an initializer. See https://doc.metalama.net/conceptual/aspects/advising/initializers.
Want results from more Discord servers?
More PostsDoes Metalama only support attributes?I navigated in all Metalama documentation, but I want to override a method for all types that inheriCan Metalama suppress compiler errors?Hello! I want to know if I can use Metalama in my library.
The users of my library have to declare Eligibility rule based on target method not returning voidTypically eligibility rules I've put together are based on a specifically typed return or paramters.Follow up question from yesterday's meetupNow that I've had time to review what was discussed I think I can now ask the question I'd wanted to