Open richardboehme opened 7 months ago
It makes sense. Reporting unknown keys included in literals should help.
Comment moved from #256
- Allows skipping
nil
-able attributes# @type var x: { name: String, email: String? } x = { name: "foo" } # OK 🐕
Ackchyually nonexistent key is distinguishable from nil
values for non-implicit-nil methods such as x.fetch :email
.
# @type var x: { name: String, ?email: String? }
x = { name: "foo" } # OK 💯
P.S. see ruby/rbs#504 regarding ?email:
When defining a record type, I expected the type checker to complain if an additional (non-defined) key was supplied by the user. Specifically I expected the following to fail type checking:
Is my assumption wrong or is this a bug in Steep? Might it be related with the change in #256?
Version tested: 1.6.0