Closed
Description
Status quo
inline def whiteBox1 <: T = ...
inline given whiteBox2 as _ <: T = ...
Critique
- Syntax is not consistent
- You could argue that the first syntax is too quiet and also misleading since at first glance
whiteBox1
is in the position where you would expect to see a type. _ <: T
is technically wrong (or, rather, old style) since it suggests a lambda. We are after an existential instead.
Proposal
Write ? <: T
(analogous to a wildcard type argument) to express both forms of whitebox macros. I.e.
inline def whiteBox1: ? <: T = ...
inline given whiteBox2 as ? <: T = ...
Opinions?