3 ms·
> Type inference locally is great. Doing `val something = MyClass()` or `val something = someFunc()` . No ambiguity, just less typing and clutter. As much as I
by iLoveOncall 4y ago
> Type inference locally is great. Doing `val something = MyClass()` or `val something = someFunc()` . No ambiguity, just less typing and clutter.
As much as I can get behind val something = new MyClass(), where the type is explicitly mentioned on the line, it's a whole other story for val something = someFunc().
You have no way to know the type of that variable without looking at the function itself which is more work than should be needed.
- Faark 4y agoYour IDE/Editor can show that information to you. Having it forced to be written down there just seems unnecessary to me.
- iLoveOncall 4y agoThe amount of time I look at code outside of an IDE is by far not zero. Just checking quickly a repository on GitHub for example.
- Faark 4y agoI agree, GitHub should consider adding this feature.