3 ms·
> In C# 9.0, you can omit the type in a new expression when the created object's type is already known. private List<WeatherObservation> _observations = new(
by cpascal 6y ago
> In C# 9.0, you can omit the type in a new expression when the created object's type is already known.
private List<WeatherObservation> _observations = new();
This is something I've long wondered why I couldn't do and I'm glad I'll be able to in C# 9.
- tandr 6y agoI wish other languages would adopt this too...