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
  • Issues
  • #2376
Closed
Open
Created Feb 06, 2024 by Jordy Aaldering@JordyAalderingDeveloper

Guards are skipped by pattern matching

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking