On Friday, 8 August 2025 at 05:19:28 UTC, monkyyy wrote:
```d
--- s.d
struct S
{
auto match(A...)=match_!A;
}
template match_(A...){
auto match_(){return 1;}
}
--- main.d
import std.sumtype;
import s;
void main()
{
S s;
assert(s.match!(_ => _) == 1);
}
```
I lik
The code looks fine.
TypeInfo is used at runtime to describe compile time constructs.
Classes require it for down casting, it is acquired from the runtime value.
For instance if the reference is null, the TypeInfo should be null as well.
On page 344 of "Programming in D", we have this snippet:
```
TypeInfo_Class info = a.classinfo;
string runtimeTypeName = info.name;
```
I've expanded it to source/app.d which when runs produces output:
```
app.Violin
app.Guitar
app.Violin
TypeInfo_Class
object.TypeInfo
```
I was expecting som