Type inference for arguments with default values?

Hi! My suggestion is, as it says in the title, to be able to infer types of arguments by looking at the type of a default value, if it is present. Example:

class Foo(val bar = "whee")

does not currently compile, giving the error: “A type annotation is required on a value parameter”. However, it seems to me like the type could easily be inferred from the value it defaults to. I may well be missing something, and of course it would not always work as it would be too ambiguous in a situation where the default value is null.

The same thing about functions recently was discussed here.

Ah I see, thanks!