Constants as array keys #9190
jrcii
started this conversation in
Psalm development (AKA internals)
Replies: 1 comment
-
|
Not sure if it was a Parser limitation. I can't think of any other reason. If you can get that to work, I'd merge it :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A few years ago @muglug stated that (paraphrasing) "array keys can't be indirect" and therefore can't be constants.
If there exists a string used both in code and would-appear-if-possible in various type definitions as keys, how would you DRY that if this isn't possible?
Is there a set/type theory/design reason for this limitation, or, is it just a hard implementation problem either in general or due to Psalm's internal architecture?
Beta Was this translation helpful? Give feedback.
All reactions