T{ ... } syntax in general isn’t gone yet (though it will be going away), it’s just void{}, because that one was always a weird special case in the language. The canonical way to write a void value is just {} (no dot).
Didn’t know about that one!
What about the either type use case? Do I have to do
const T = if (@TypeOf(T) == void) {} else .{}; for default initialization now?
const x: if (condition) T else void = if (condition) .{} else {};
// or, equivalently, because `else {}` is the "default" so to speak:
const x: if (condition) T else void = if (condition) .{};
Also, if you’re writing a struct field with a default value (rather than initializing a const/var), consider whether you should actually be giving it a default value! Most struct fields shouldn’t have default values.
That second thing is black magic to me, I didn’t know you could do that! I do think struct{} over void might have the advantage even with that trick, because it wouldn’t require any checking, myVar = .{}; would always work
For default initialization
When doing a GUI library for the text rendering layout stuff I was in a situation where I speculate the combination of metaprogramming + default initialization probably made the code 3x smaller. I can share the code if needed (will share the whole library when it’s finished).
For the migration:
I don’t think I encountered the second example I provided (or if I did then it was once), where I need default initialization of void because of an either type. That was more trying to figure out the worse case scenario.
The migration was easy in general, at least for that project.