I tested it with the new Beta type solver as well, seems like it also doesn’t support that either. Hopefully this will be fixed with the full release of the new type solver
This isn’t really a solution but rather an explanation. From what I can tell, primitive dictionary types (denoted as {[k]: v}) only accept primitive values as keys in contrast to complex “dictionary” types (they behave more like objects), which allow you to use literal types as keys and assign each key a unique type. Now I don’t think this is a bug, especially when you consider that you’re denoting a common key and value type respectively anyways, which would defeat the purpose of using it in the first place.
The reason for denoting the string and Argument types is so that every sub-dictionary (such as Args.player) automatically registers as the type ‘Argument’. Unless there’s an alternative way to do this easily, enabling us to not specify types, I’d still consider this an unintended feature which would benefit from being reported.
As I said in my first post, primitive dictionary annotations aren’t really meant for that. They are simply used to denote a common key and value type that is the same through out the entire table, whereas the type of annotation I proposed is exactly meant for that where a common key or value type may or may not be present.
Edit: keep in mind that literals are not valid key types anyways, they are polymorphic unless collapsed into a certain state, therefore are not hashable.
I personally don’t think it should be a thing as simply denoting each possible key literal as a different key and assigning the appropriate type to it does the job pretty well, and in my opinion would be a lot more readable than this.