If you want to use expressions use settings. The processing pre-processor hides the fact that processing uses settings under the hood before the java code gets compiled.
If you read the documentation of the size() function, it says:
As of Processing 3.0, to use variables as the parameters to size() function, place the size() function within the settings() function (instead of setup() ). There is more information about this on the settings() reference page.
The settings() function is new with Processing 3.0. It’s not needed in most sketches. It’s only useful when it’s absolutely necessary to define the parameters to size() with a variable.
Everything is explained here and it’s not specific to Processing 4 beta
Also save as works without trouble on Processing 4.0b2. If you have any reproducible bugs, please report them on the GitHub issue page: Issues · benfry/processing4 · GitHub
I tried (for fun) setting size in a object initializer section which is to help setup inner classes, it didn’t work, but the error report was better. Lol.
Eg.