Just want to get your opinion before I add something to trac.
- Code: Select all
class Program
def main
assert 3.0.getType.toString == "System.Single"
If I was to compile this for the first time with -number:float32 it would work, correctly.
If I compile it again with -number:float64 it wouldn't work, correctly.
But if on the second compile I'd had -compile-if-needed it would have continued working, incorrectly.
I'm thinking that what's defined as 'if needed' might need to include if the already compiled program was compiled with a different -number setting than what's being attempted. I have no idea so far what that would entail in the compiler, and it's probably pretty edge case, but it could confuse someone at some point when it's in something non-trivial.
- Code: Select all
nev@bananinha:~/Temp/cobra$ cobra -number:float32 test2.cobra
nev@bananinha:~/Temp/cobra$ cobra -number:float64 test2.cobra
An unhandled exception has occurred.
<snip>
Unhandled Exception: Cobra.Lang.AssertException: (Good)
<snip>
nev@bananinha:~/Temp/cobra$ cobra -number:float32 test2.cobra
nev@bananinha:~/Temp/cobra$ cobra -compile-if-needed -number:float64 test2.cobra
nev@bananinha:~/Temp/cobra$ (Oops!)