Yes, it's exactly as @prep says: the ifdef is eliminated before the type inference happens. Maybe in the future we can allow some code to be evaluated in the ifdef, but for now that's not possible.

Another issue is that you can't currently compare classes. Well, you can but it crashes the compiler. We need to fix this eventually.