Skip to content

check E006 false positive: parseDateTimeUTC() with a default value (3 arguments) is rejected, but Mendix accepts it (mx check 0 errors) #1216

Description

@MohamedElNady

Environment

  • mxcli: v0.24.0 (2026-09-24T05:44:35Z), Windows (Git Bash)
  • Mendix: 11.14.0, blank project from mx create-project (MPR v2)
  • Studio Pro: closed

Summary

Mendix's parseDateTimeUTC(string, format, defaultValue) has an optional third argument, returned when parsing fails; parseDateTime has the same overload. mxcli's expression checker only knows the 2-argument form and blocks the script with E006. Because exec refuses when check finds an error, the valid form can only be written with --no-check.

Reproduction

create module "ModE";
create microflow "ModE"."SUB_Parse" ($Text: String) returns DateTime as $D
begin
  declare $D DateTime = parseDateTimeUTC($Text, 'yyyy-MM-dd', empty);
  return $D;
end;
/
$ mxcli check repro.mdl -p Repro.mpr --references
  ✗ parseDateTimeUTC() expects 2 argument(s), got 3. [E006]
      → Provide 2 argument(s) for parseDateTimeUTC().

$ mxcli exec repro.mdl -p Repro.mpr --no-check
Created microflow: ModE.SUB_Parse
$ mx check Repro.mpr
The app contains: 0 errors.

describe microflow round-trips the 3-argument call unchanged.

Expected

E006 accepts 2 or 3 arguments for parseDateTimeUTC / parseDateTime, and presumably the other parse functions that take a default value.

Actual

check rejects valid Mendix, which pushes authors to a 2-argument parse plus a custom error handler. That is more complex, and with the default with rollback handler it is easy to get wrong.

mxcli diag --bundle is available on request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions