What you see errors for the same reason it errors without the @static, the macro needs to be evaluated BEFORE the toplevel expression (i.e. if ... or @static if ...) can run so the macro is evaluated BEFORE you imported the module. Repeat if twice, first with import and second time with the macro should work. Note that for the import/using you don’t need @static. You only need it for the @sk_import since it’s a macro.
Oh understood. So any macro in a code block is evaluated (or expanded) before anything else than itself. That makes sense. It should be very helpful to new comers if that is mentioned in the manual (seems not). The double ifs or @static ifs work fine. Thanks a lot!