It looks like the order of the files on the cobra command line requires that the file with the 'use Cairo' come first, but not just any file with the use has to be first, it has to be one of the files containing the parts of the partial class.
Is that a bug, or is it just something to be aware of when using partial classes?
I'm guessing it's a bug since if Thing inherit a class the compiler doesn't care which file i put that in, or which order the files are compiled, as long as it's not in both, so it seems it's not truly an ordering dependency on partials.
But if it's the later, what is the recommended course of action? 1/ put the same uses in the various files of the partial class, or 2/ manage the ordering dependencies for the compile?
Both seem ok if the compiler can't figure it out, but at the same time are not ideal, since obviously I only want uses in the files that need them. Are there many things that require specific orders of files in the compile?
Cheers,
N
- Code: Select all
test.cobra
class Program
def main
pass
test2.cobra
use Cairo from Mono.Cairo
class Thing is partial
def stuff
pass
test3.cobra
class Thing is partial
def draw(context as Context)
context.stroke
cobra test.cobra test2.cobra test3.cobra (OK)
cobra test.cobra test3.cobra test2.cobra (No good)
- Code: Select all
test.cobra
class Program
def main
pass
test2.cobra
class Thing is partial
def stuff
pass
test3.cobra
use Cairo from Mono.Cairo
class Thing is partial
def draw(context as Context)
context.stroke
cobra test.cobra test2.cobra test3.cobra (No good)
cobra test.cobra test3.cobra test2.cobra (OK)
- Code: Select all
use Cairo from Mono.Cairo
test.cobra
class Program
def main
pass
test2.cobra
class Thing is partial
def stuff
pass
test3.cobra
class Thing is partial
def draw(context as Context)
context.stroke
cobra test.cobra test2.cobra test3.cobra (No good)
cobra test.cobra test3.cobra test2.cobra (No good)