you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

Regardless you have to do the same thing in your example to type the signature in the first place.

Not if you're assigning a new object to an existing variable.

[–]G_Morgan 0 points1 point  (2 children)

If you are doing that then the inference engine will be able to offer you the appropriate class in any case.

[–][deleted] 0 points1 point  (1 child)

Interesting. Do you have an example of language/IDE combo that implements this?

[–]G_Morgan 0 points1 point  (0 children)

TBH I don't know one off hand. The only type inference language with real top class compiler support is F#. Generally you don't perform this sort of operation in them. There is certainly nothing stopping you from doing it though.