It seems that a function can "accept" explicit generic parameters in this situation:
func z() -> Int { 1 } // Non generic function
func z<T: FloatingPoint>() -> T { 1 } // Generic overload of that function
let y: Int = z<Float>() // Nonsense syntax compiles (the parameter is ignored but there is no error)
It does not seem to happen when either of the overloads is commented out, catching the invalid syntax.
Expected behavior
An error message detecting the misleading syntax.
Environment
Apple Swift version 6.0-dev (LLVM 3417addab6ff197, Swift d677b7c23fd6355)
Target: arm64-apple-macosx14.0
Description
Swift is allowing a syntax mistake.
Reproduction
It seems that a function can "accept" explicit generic parameters in this situation:
It does not seem to happen when either of the overloads is commented out, catching the invalid syntax.
Expected behavior
An error message detecting the misleading syntax.
Environment
Additional information
No response