Title: Fix array dimension mismatch errors · Issue #2841 · lcompilers/lpython · GitHub
Open Graph Title: Fix array dimension mismatch errors · Issue #2841 · lcompilers/lpython
X Title: Fix array dimension mismatch errors · Issue #2841 · lcompilers/lpython
Description: With the recent libasr sync, we are seeing the following issue with multi-dimensional arrays in LPython. (lp) ubaid@DESKTOP-UR96JOC:~/lpython$ cat examples/expr2.py from lpython import i32 from numpy import empty, int32 def main0(): x: i...
Open Graph Description: With the recent libasr sync, we are seeing the following issue with multi-dimensional arrays in LPython. (lp) ubaid@DESKTOP-UR96JOC:~/lpython$ cat examples/expr2.py from lpython import i32 from num...
X Description: With the recent libasr sync, we are seeing the following issue with multi-dimensional arrays in LPython. (lp) ubaid@DESKTOP-UR96JOC:~/lpython$ cat examples/expr2.py from lpython import i32 from num...
Opengraph URL: https://github.com/lcompilers/lpython/issues/2841
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fix array dimension mismatch errors","articleBody":"With the recent libasr sync, we are seeing the following issue with multi-dimensional arrays in LPython.\n\n```bash\n(lp) ubaid@DESKTOP-UR96JOC:~/lpython$ cat examples/expr2.py \nfrom lpython import i32\nfrom numpy import empty, int32\n\ndef main0():\n x: i32[2, 5] = empty([2, 5], dtype=int32)\n print(x)\n\nmain0()\n(lp) ubaid@DESKTOP-UR96JOC:~/lpython$ PYTHONPATH=./src/runtime/lpython python examples/expr2.py \n[[ 947372589 22011 0 0 -1864968336]\n [ 32530 -1864968272 32530 48 0]]\n(lp) ubaid@DESKTOP-UR96JOC:~/lpython$ ./src/bin/lpython examples/expr2.py \nsemantic error: Type mismatch in annotation-assignment, the types must be compatible\n --\u003e examples/expr2.py:5:5\n |\n5 | x: i32[2, 5] = empty([2, 5], dtype=int32)\n | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i32[2,5]' and 'i32[10]')\n\n\nNote: Please report unclear, confusing or incorrect messages as bugs at\nhttps://github.com/lfortran/lfortran/issues.\n```\n\nFixing the above should hopefully get several of our array integration tests working again.","author":{"url":"https://github.com/ubaidsk","@type":"Person","name":"ubaidsk"},"datePublished":"2025-03-31T06:00:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/2841/lpython/issues/2841"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bfb7f6f8-7da8-9d74-bda8-01f33a9b1d0c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD64:2B1BC5:62ECEE:87A3AF:6977538D |
| html-safe-nonce | 27e9c727bde9f8517130fbb3d470841bc15e97a81867bf2530c2bcc88fc10003 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDY0OjJCMUJDNTo2MkVDRUU6ODdBM0FGOjY5Nzc1MzhEIiwidmlzaXRvcl9pZCI6Ijg2NTM1ODY3MjYzNTU2ODYyODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3616d618917791009513ac548084a69ee6656c64e8969ff0f7b115abda2df4ed |
| hovercard-subject-tag | issue:2959545197 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/lcompilers/lpython/2841/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b9f8787284204279c5a30defc46373cd2343d2f6d2e805b2cb6c275ad992f98c/lcompilers/lpython/issues/2841 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b9f8787284204279c5a30defc46373cd2343d2f6d2e805b2cb6c275ad992f98c/lcompilers/lpython/issues/2841 |
| og:image:alt | With the recent libasr sync, we are seeing the following issue with multi-dimensional arrays in LPython. (lp) ubaid@DESKTOP-UR96JOC:~/lpython$ cat examples/expr2.py from lpython import i32 from num... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ubaidsk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3310064f35a62c06a4024ba37f41c06836f39376a095c2dfd2c4b693c34965be |
| turbo-cache-control | no-preview |
| go-import | github.com/lcompilers/lpython git https://github.com/lcompilers/lpython.git |
| octolytics-dimension-user_id | 96538276 |
| octolytics-dimension-user_login | lcompilers |
| octolytics-dimension-repository_id | 442864346 |
| octolytics-dimension-repository_nwo | lcompilers/lpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 442864346 |
| octolytics-dimension-repository_network_root_nwo | lcompilers/lpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 67d5f8d1d53c3cc4f49fc3bb8029933c3dc219e6 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width