C
C#9mo ago
2spooky2play

✅ `T` always value for `nameof`

int id = nameof(T).GetHashCode();
Console.WriteLine(nameof(T));
int id = nameof(T).GetHashCode();
Console.WriteLine(nameof(T));
how come nameof(T) always returns T instead of the type of the generic argument?
2 Replies
2spooky2play
2spooky2playOP9mo ago
fixed: needed to use typeof instead of nameof
MODiX
MODiX9mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server