]> git.xonotic.org Git - xonotic/gmqcc.git/blob - tests/dots.qc
Unused globals even if they have an initial value should produce unused diagnostic
[xonotic/gmqcc.git] / tests / dots.qc
1 entity self;
2 .float f;
3 ..float fp;
4 ...float fpp;
5
6 void try(entity e, ...float pp) {
7     print("and: ", ftos( e.(e.(e.pp)) ), "\n");
8 }
9
10 typedef float Float;
11
12 void try2(entity e, ...Float pp) {
13     print("and: ", ftos( e.(e.(e.pp)) ), "\n");
14 }
15
16 // whereas the varargs are tested in vararg tests
17
18 void main() {
19     self = spawn();
20     self.f = 123;
21     self.fp = f;
22     self.fpp = fp;
23     print(ftos(  self.(self.fp)  ), "\n");
24     print(ftos(  self.(self.(self.fpp))  ), "\n");
25     try(self, fpp);
26     try2(self, fpp);
27 }