mysterious "Invalid statement" Zscript errors

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: mysterious "Invalid statement" Zscript errors

Re: mysterious "Invalid statement" Zscript errors

by _mental_ » Wed Feb 06, 2019 4:10 am

Fixed in 78c0b7f.

Re: mysterious "Invalid statement" Zscript errors

by Graf Zahl » Wed Feb 06, 2019 3:45 am

_mental_ wrote:It's a code generation error because construct with a constant condition is valid.
Yes, but that means that FxNop may not have an error type. FxNop is meant as a valid stand-in for an empty statement where null is not viable.

Re: mysterious "Invalid statement" Zscript errors

by _mental_ » Wed Feb 06, 2019 2:53 am

It's a code generation error because construct with a constant condition is valid.

TypeVoid for FxNop fixes the issue as well. Should we prefer this solution over my PR?

Re: mysterious "Invalid statement" Zscript errors

by Graf Zahl » Wed Feb 06, 2019 2:51 am

Errors, yes, but this should at most be a warning.

Re: mysterious "Invalid statement" Zscript errors

by _mental_ » Wed Feb 06, 2019 2:47 am

Probably, yes. Actually, I thought TypeError was used to catch errors like this.

Re: mysterious "Invalid statement" Zscript errors

by Graf Zahl » Wed Feb 06, 2019 2:45 am

Wouldn't it be better to give FxNop a non-error type instead?

Re: mysterious "Invalid statement" Zscript errors

by _mental_ » Wed Feb 06, 2019 2:40 am

It's caused by no-op expressions, like

Code: Select all

if (const_evaluated_to_false) // ...
I think this should be fixed like this.

mysterious "Invalid statement" Zscript errors

by JPL » Wed Feb 06, 2019 2:02 am

A mod I released last year has started failing on startup in recent-ish versions of GZDoom. 4 errors that all say "Invalid statement", two of them on the same line. A couple of the lines in question are simple function overrides, eg

Code: Select all

override void PostBeginPlay()
, and no further information is given so it's pretty unclear what the real problem is or how to fix it.

You can download the latest released version of the mod here: https://jp.itch.io/mr-friendly

Top