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
  • #2407
Closed
Open
Created Apr 17, 2024 by Jordy Aaldering@JordyAalderingDeveloper

Type patterns on records should use primitive _dim_A_ and _shape_A_

When type patterns are being applied to user-defined types we assume that dim and shape are overloaded for those types. We then apply those functions in the generated code, instead of the primitives _dim_A_ and _shape_A_ because these functions cannot exist for such user-defined types.

However in the case of records we actually expand these into their separate arguments, to which these primitive functions CAN be applied.

struct Foo { int x; int y; };

int bar(struct Foo[*] foos) {
    _shape_A_(foos);
}

Becomes:

struct Foo { int x; int y; };

int bar(int[*] foos_x, int[*] foos_y) {
    _shape_A_(foos_x);
}

So if we find a type pattern on a record, we should apply the primitive functions instead.

Edited Apr 17, 2024 by Jordy Aaldering
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking