Skip to content

improve missing properties type error#2558

Open
nnullcolumn wants to merge 3 commits into
luau-lang:masterfrom
nnullcolumn:better-missing-properties-type-error
Open

improve missing properties type error#2558
nnullcolumn wants to merge 3 commits into
luau-lang:masterfrom
nnullcolumn:better-missing-properties-type-error

Conversation

@nnullcolumn

Copy link
Copy Markdown

before:
Table type '{ cafood: string, tag: "cat" }' not compatible with type 'Cat' because the former is missing field 'catfood'
after:
required field 'catfood' not found in type '{ cafood: string, tag: "cat" }' from expected type 'Cat'

before:
Table type '{| x: number, y: number |}' not compatible with type 'Super' because the former has extra field 'y'
after:
extra field 'y' found in type '{| x: number, y: number |}' from expected type 'Super'

@hgoldstein hgoldstein left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! However, even "less critical" changes like this should be flagged.

@hgoldstein hgoldstein self-assigned this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List missing properties *before* the stringified table type in TypeError messages

2 participants