Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !276

Don't skip guards in pattern matching utility

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jordy Aaldering requested to merge 2376-pattern-match-skips-guards into develop Feb 06, 2024
  • Overview 5
  • Commits 4
  • Changes 4

In the following example, we would want a type pattern error.

int div (int x, int y) | _neq_SxS_ (y, 0)
{
    return _div_SxS_ (x, y);
}

int main()
{
    return div (4, 0);
}

However, pattern matching skips guards, instead resulting in SCSprf_div_XxS: Division by zero encountered We should not skip over guards, so that the error message(s) can be generated by type patterns instead.

In the future we should investigate whether we actually ever want to skip over guards (be they type pattern guards, or conformity checks). However for now we will only exclude the F_guard case.

Closes #2376 (closed)

Edited Feb 07, 2024 by Jordy Aaldering
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: 2376-pattern-match-skips-guards