Skip to content

Type check StructPatternFieldIdentPat#2174

Merged
philberty merged 1 commit into
Rust-GCC:masterfrom
powerboat9:ipat-type
Apr 28, 2023
Merged

Type check StructPatternFieldIdentPat#2174
philberty merged 1 commit into
Rust-GCC:masterfrom
powerboat9:ipat-type

Conversation

@powerboat9

Copy link
Copy Markdown
Collaborator

No description provided.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc
	(TypeCheckPattern::visit): Type check StructPatternFieldIdentPat.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>

@philberty philberty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM nice work.

Side thing to check (not related to your PR) we use a break to get out of the switch statement here but i am just wondering what would happen if we just returned early after an error if that would be safer/simpler but maybe we miss a chance to keep looking for more errors. Do you have an opinion here about the error handling.

@philberty philberty added this pull request to the merge queue Apr 28, 2023
Merged via the queue into Rust-GCC:master with commit 48510f4 Apr 28, 2023
@powerboat9

Copy link
Copy Markdown
Collaborator Author

It's probably good as-is, that way we can generate both invalid field and missing field errors.

@powerboat9 powerboat9 deleted the ipat-type branch April 28, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants