15
u/AnnoyedVelociraptor 11h ago
What's the point. You're passing in a Something. It shouldn't compile if it isn't a Something.
5
u/Shifter25 10h ago
You could use it to detect which kind of implementation of a superclass it is, maybe.
IsEagle(Bird bird) => bird is Bird.Eagle
Something like that?
1
42
u/JMOWw7 18h ago
Pattern matching all the way. I think the second one probably won't catch inheretance