fix missing type check in dictionary literal
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/31375
Test Plan: Imported from OSS
Differential Revision: D19145440
Pulled By: zdevito
fbshipit-source-id: 69909089586149ef766b4858d3420864a81b2493