Slackbot
01/23/2024, 11:05 PMVampire
01/23/2024, 11:27 PMnamed, newInstance couldn't construct it.
The differences are also layed out in the JavaDoc of those two methods. Things created with named for example are not decorated and not extensible.
For using newInstance you could for example change the signature to
abstract class MyNamedType @Inject constructor() : Named
then both methods can construct such objects.Octavia Togami
01/24/2024, 12:47 AMnamed has extra validation and also states
Objects created using this method are not decorated or extensible.
whereas newInstance states
Objects created using this method are decorated and extensible