Method syntax is different because it guaranteedly has receiver expression that usually allows to guess the type. For example foo.bar()
communicates nearly the same amount of type information as Foo::bar(foo)
and, what matters, it's clear that in most of cases using the former would be redundant. Moreover, the thing on which methods are called has a bigger chance of already being "explicitly typed" e.g. it could be a method argument, new instance of enum/struct, or return value of a generic method like .collect()
or .into()
.
I'd also say that method syntax is either a counterexample, since lack of explicit types allows to easily write confusing code with it. For example long method chains usually are an antipattern and already a lot of discipline is required to know where to introduce a temporary variable, how to name it, etc.
Perhaps the situation when we introduce enum variable could be added to that:
let cookie_handling = .Skip;
...
Options {
cookie_handling,
...
}
But nothing else comes into my mind.