dox
dox copied to clipboard
[docs] haxe.macro.ExprDef EReturn(Expr) should be EReturn(Null<Expr>)
In the macro API documentation here, the EReturn ExprDef is stated as having an Expr parameter, but it accepts null, and with a null parameter it becomes a plain return;
statement. In other cases of ExprDef, where behavior is different when passing a null parameter, the documentation shows the parameter typed as Null<Expr> so it should be for EReturn as well. I checked the ExprDef source and found that in the code the type is correct as of two years ago, so the documentation must be out of date.
Hmm. Null<Expr>
has indeed been removed in development
branch, but expr
is still optional EReturn(?e:Expr)
. Maybe some dox issue?
The API doc pages all say that they're generated for 4.1.3, and looking at the 4.1.3 source for ExprDef I see that EReturn is different from the other types with optional params.
EReturn(?e:Null<Expr>);
vs.
ESwitch(e:Expr, cases:Array<Case>, edef:Null<Expr>);
EIf(econd:Expr, eif:Expr, eelse:Null<Expr>);
As of 4.1.3, EReturn's param is declared with both ?
and Null<>
. Maybe that caused the problem. On development, it changed to just ?
but EIf and ESwitch are still using Null<>
. Maybe dox hides ?
declarations?
The same thing happened to column
parameter in https://api.haxe.org/haxe/StackItem.html#FilePos
This is indeed a dox' issue.