type aliases no longer work?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the error on cinder/3.10 with fannkuch_static_lib.py and nqueens_static_lib.py, then inspect the ArrayI64 alias and the count annotations shown in the issue. Compare the alias form with the direct Array[int64] form and trace where the compiler reports the TypedSyntaxError. Done means the alias form behaves consistently with the direct type form without the reported mismatch.
Written by the indexing model from the issue text.
Description
On cinder/3.10, fannkuch_static_lib.py and nqueens_static_lib.py give errors like this:
File "fannkuch_static_lib.py", line 29
count[r - 1] = r
compiler.errors.TypedSyntaxError: type mismatch: int64 cannot be assigned to dynamic
The array count is defined using a type alias:
ArrayI64 = Array[int64]
....
count: ArrayI64 = ArrayI64(range(1, nb + 1))
Changing the definition to use the type directly removes the error:
count: Array[int64] = ArrayI64(range(1, nb + 1))
That's surprising! Did something break with type aliases?
cc @vivaan2006 who helped discover this
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from facebookincubator/MetaPython
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
facebookincubator/MetaPython#147 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
facebookincubator/MetaPython#146 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
facebookincubator/MetaPython#145 · 4 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
facebookincubator/MetaPython#144 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
facebookincubator/MetaPython#129 · 2 comments ·
All issues in facebookincubator/MetaPython
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100