Skip to content

Field names are not checked inside match arms #788

Description

@whataboutpereira

I noticed fields are not checked inside match and yield no error.

        match (true) {
            true => $qb->orderBy('p.nonexistent', 'ASC'),
        };

The same with switch correctly yields an error no field or association named nonexistent.

        switch (true) {
            case true:
                $qb->orderBy('p.nonexistent', 'ASC');
                break;
        }

Is this because of Do not pass QueryBuilder to methods or is it something that can be solved?

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