efemoney
05/25/2018, 8:58 AM@Named("coins") Safe coinSafe;
@Named("jewelry") Safe jewelrySafe;
In a large codebase people might forget to add the right annotation or in the case of Named
, the correct value.
Being able to create a typealias
like below would be really helpful.
typealias CoinSafe = @Named("coins") Safe
typealias JewelrySafe = @Named("jewelry") Safe
// and usage becomes
CoinSafe coinSafe;
JewelrySafe jewelrySafe;
I’m also quite skeptical though, because typealias
(right now) implies interchangeability and for special cases/mistakes with this feature, interchanging types might introduce bugs.benleggiero
05/26/2018, 4:06 AMtypealias CoinSafe = @Named("coins") Safe
typealias What = @Named("what") CoinSafe
gildor
05/27/2018, 9:56 AMefemoney
06/01/2018, 8:18 AMgildor
06/01/2018, 9:38 AMgildor
06/01/2018, 9:38 AMString
and String?