[Idea] `.func(args...)` as a sugar of constructor `InferredType::func(args...)`

And, importantly, also requires that the trait has been used, so there's a limited search scope.

If foo(.bar()) worked, what's the scope of things in which the compiler would search for that method? Or even worse, what if it's a fallible constructor so it's foo(.bar().unwrap()) or foo(.bar()?)?

(The oft-discussed idea of allowing foo(.Blah) (or foo(_::Blah) is limited to enum variants, which have the rule that even when they're "functions" they definitely return Self. It's not obvious to me that there's a good way to extend this to any arbitrary inherent method. Traits maybe, though?)

1 Like