Summary
Grayscale supports wildcard types ? (STANDARD.md §7.9) and type parameters <?> (§7.10) for generic-style functions. The LSP has no awareness of either feature.
Wildcard Types
do identity(x ?) -> ? {
return x
}
do first(arr [?]) -> ? {
return arr[0]
}
? is valid only in function parameter types and return types. All ? in a signature bind to the same concrete type.
Type Parameters
do make(T <?>) -> ^? {
return new(T)
}
mut p = make(Point) // returns ^Point
<?> allows passing a struct type name as an argument. Cannot mix with value parameters.
Scope
- Recognize
? as a valid type in function signatures for syntax awareness
- Recognize
<?> parameter syntax
- Add hover docs explaining both features
Summary
Grayscale supports wildcard types
?(STANDARD.md §7.9) and type parameters<?>(§7.10) for generic-style functions. The LSP has no awareness of either feature.Wildcard Types
?is valid only in function parameter types and return types. All?in a signature bind to the same concrete type.Type Parameters
<?>allows passing a struct type name as an argument. Cannot mix with value parameters.Scope
?as a valid type in function signatures for syntax awareness<?>parameter syntax