No. The code that gets the compilation error is obviously not running. Pike doesn't run a program until after it's been successfully compiled, right?
And if you don't like the environment dependence, replace that with a module that's generated at install time. The code handles a compile constant, say "x", that can be a string or an int. It wants to compare it to some constant values:
// Created at install time. Contains // either constant x = 7; or constant x = "foo"; import config; ... if (x == 10) ...
It's insane to have to rewrite that as
if (numberp(x) && (int) x == 7) ...
just to get it through the compiler. Next thing, we're defining the type of numberp so that numberp("foo") also generates a compile time error.
I mean, if 7 == "foo" is not a run time error (and it isn't, it just evaluates to 0, and that's by *design*, not because of a bug in the run time type checking), then it's utterly broken to generate a compile time error for the same expression. I'm getting annoyed, so I'll shut up now.
/ Niels Möller ()
Previous text:
2003-02-12 18:30: Subject: Search bug ?
Those are run-time checks.
/ Peter Bortas