@aliokan: thanks for the effort. I guess the reason for the error is that the class that uses the js package is included into the compilation. I found out why it is doing this but not sure how to fix it “properly”.
So what I wanted to do in the macro is check whether the current local class (obtained through Context.getLocalClass()) inherits from a given class.
To do this I created something like this:
public function InheritsFrom(classType : ClassType, parentClass : Class<Dynamic>) : Bool
// Use it as:
The nice thing about this is that compilation fails if the namespace.something.MyClass changes. The downside is that by doing this the compiler includes MyClass and everything is uses which caused the js package error.
I guess I can do the InheritsFrom function with a string (like “namespace.something.MyClass”) but I was hoping for a bit more elegant approach.
Note: the static extensions do not work in macros so I found another way around this using abstract types.