File tree 3 files changed +5
-6
lines changed
main/java/de/peeeq/wurstscript/validation
test/java/tests/wurstscript/tests 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,7 @@ public void visit(ExprVarAccess e) {
61
61
if (!definedVars .contains (g )
62
62
&& !g .attrIsDynamicClassMember ()
63
63
&& g .attrNearestNamedScope () == p ) {
64
- e .addWarning ("Global variable " + e .getVarName () + " must be declared before it is used. " +
65
- "This will be an error in future Wurst versions." );
64
+ e .addError ("Global variable <" + e .getVarName () + "> must be declared before it is used." );
66
65
// add variable to defined vars to silence further warnings:
67
66
definedVars .add (g );
68
67
}
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public void test_init_order_jass_warning() {
132
132
133
133
@ Test
134
134
public void test_init_order_globals_warning () {
135
- testAssertErrorsLines (false , "Global variable b must be declared before it is used." ,
135
+ testAssertErrorsLines (false , "Global variable <b> must be declared before it is used." ,
136
136
"package test" ,
137
137
" integer a = b" ,
138
138
" integer b = 3" ,
Original file line number Diff line number Diff line change @@ -391,12 +391,12 @@ public void ondestroy_dynamicdispatchFrotty1() {
391
391
testAssertOkLines (true ,
392
392
"package test" ,
393
393
" native testSuccess()" ,
394
+ " string s=\" \" " ,
394
395
" class A extends T" ,
395
396
" class B extends T" ,
396
397
" ondestroy" ,
397
398
" s += \" B\" " ,
398
399
" abstract class T" ,
399
- " string s=\" \" " ,
400
400
" init" ,
401
401
" T t = new A()" ,
402
402
" destroy t" ,
@@ -411,14 +411,14 @@ public void ondestroy_dynamicdispatchFrotty2() {
411
411
testAssertOkLines (true ,
412
412
"package test" ,
413
413
" native testSuccess()" ,
414
+ " string s=\" \" " ,
414
415
" class A implements T" ,
415
416
" class B implements T" ,
416
417
" ondestroy" ,
417
418
" s += \" B\" " ,
418
419
" interface T" ,
419
420
" function f()" ,
420
421
" skip" ,
421
- " string s=\" \" " ,
422
422
" init" ,
423
423
" T t = new A()" ,
424
424
" destroy t" ,
@@ -433,6 +433,7 @@ public void ondestroy_dynamicdispatchFrotty3() {
433
433
testAssertOkLines (true ,
434
434
"package test" ,
435
435
" native testSuccess()" ,
436
+ " string s=\" \" " ,
436
437
" abstract class C" ,
437
438
" ondestroy" ,
438
439
" s+=\" C\" " ,
@@ -443,7 +444,6 @@ public void ondestroy_dynamicdispatchFrotty3() {
443
444
" interface T" ,
444
445
" function f()" ,
445
446
" skip" ,
446
- " string s=\" \" " ,
447
447
" init" ,
448
448
" T t = new A()" ,
449
449
" destroy t" ,
You can’t perform that action at this time.
0 commit comments