Steps to reproduce:
- Create a new project using Universal 3D Template
- Import the attached WarnProbe.cs and ArgProbe.cs Assets into Assets folder
- Wait for script compilation to finish
- Open Edit > Project Settings > Player > Other Settings > Script Compilation
- Under Additional Compiler Arguments, click +, type -define:QA_ARG and click Apply
- Wait for script compilation to finish
- Open the Console window
- Under Additional Compiler Arguments, click + again, type -warnaserror+ and click Apply
- Wait for script compilation to finish and observe the Console
Actual results: After step 7 the Console shows "QA ArgProbe: QA_ARG is NOT defined". After step 10 the Console shows "WarnProbe.cs(1,48): warning CS0168: The variable 'unused' is declared but never used" and compilation succeeds. Both arguments are ignored
Expected results: After step 7 the Console shows "QA ArgProbe: QA_ARG is defined". After step 10 CS0168 is reported as an error and compilation fails
Reproducible with: 7000.0.0a23 (44b2333ec962), 7000.0.0b1
Not reproducible with: 6000.0.86f1, 6000.3.30f1, 6000.6.12f1, 6000.7.0f1, 7000.0.0a22 (dbac4d68c4de)
Tested on: macOS 27.2 (Apple M1 Max), Ubuntu 24.04