vala and valac have different behavior when compiling multiple files
test.vala
void testfunc(){
a++;
}
void main(){
testfunc();
print (@"$a");
}
test2.vala
int a = 7;
when >vala test.vala test2.vala
> vala test.vala test2.vala
/tmp/cc0r2LoV.o:(.data+0x0): multiple definition of `a'
/tmp/ccuiJLSM.o:(.data+0x0): first defined here
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
error: cc exited with status 256
and when >valac test.vala test2.vala && ./test
8
In a real program, I get errors about re-declaring functions too, but in a small example I failed to reproduce it.