Raise an error if point or rectangle constructor take an incorrect number of arguments.

[GB.GEOM]
* BUG: Raise an error if the rectangle constructor does not take zero or four arguments.
* BUG: Raise an error if the point constructor does not take zero or two arguments.
This commit is contained in:
gambas 2021-11-02 12:20:07 +01:00
parent 394ea76e2c
commit c0345b99ab
2 changed files with 8 additions and 0 deletions

View file

@ -189,6 +189,10 @@ BEGIN_METHOD(__name##_new, __gtype x; __gtype y; __gtype w; __gtype h)
{ \
__this->x = VARG(x); \
__this->y = VARG(y); \
} \
else if (!MISSING(x) || !MISSING(y)) \
{ \
GB.Error("Not enough arguments"); \
} \
\
END_METHOD \

View file

@ -53,6 +53,10 @@ BEGIN_METHOD(__name##_new, __gtype x; __gtype y; __gtype w; __gtype h)
__this->w = VARG(w); \
__this->h = VARG(h); \
__struct##_normalize(__this); \
} \
else if (!MISSING(x) || !MISSING(y) || !MISSING(w) || !MISSING(h)) \
{ \
GB.Error("Not enough arguments"); \
} \
\
END_METHOD \