You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
Currently we still have underscore as wildcard for default values:
var i: Int = _ // i = 0
var s: String = _ // s = null
Can we have a wildcard value, besides the wildcard type we just implemented? Something like
var i: Int = ? // i = 0
var s: String = ? // s = null
var a: Any = ? // indeterminate type
var av: AnyVal = ? // indeterminate type
var d: Double = av // determined as type specified, d = 0.0
var ar: AnyRef = ? // indeterminate type
var foo: Foo = ar // determined as type specified, foo = null: Foo
def bar[T]: T = ? // generic
var bar1 = bar[Any] // bar1: Any = ? indeterminate type
var bar2 = bar[Double] // bar2: Double = 0.0
and broaden the use of this syntax to local variables as well (currently it only works for class field)
Currently we still have underscore as wildcard for default values:
Can we have a wildcard value, besides the wildcard type we just implemented? Something like
and broaden the use of this syntax to local variables as well (currently it only works for class field)
Originally posted by @texasbruce in scala/scala3#5379 (comment)
The text was updated successfully, but these errors were encountered: