Would a Placeholder Type be Useful?

A TypeAlias

The classic example of a type alias is the Point. In Swift you alias the tuple like this:

typealias Point = (Int, Int)

let origin: Point = (0, 0)

I just saw this article about a new Swift language feature called a Type Placeholder.

Type placeholders (formerly, "Placeholder types")

"When Swift's type inference is unable to work out the type of a particular expression, it requires the programmer to provide the necessary type context explicitly. However, all mechanisms for doing this require the user to write out the entire type signature, even if only one portion of that type is actually needed by the compiler."

The article by Sarun helps. But I've got a different need in mind.

When designing at the Xcode keyboard every now and then you need a type for example in a parameter list, but your not real sure what type that parameter may need to be... a String can work for a bit and allow your flow to continue. But then you may forget to come back and replace that String type with the actual type required. So what if you typealiased the String:

typealias Placeholder = String

Then you could compose the method and have an obvious place to remind you to come back and improve.

let point = circleTangent(line: Placeholder)


Underscore as Placeholder

Swift 5.6 placeholder types explained by Sarun: Swift Type Placeholder (_).