Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typecheck: Add basic typechecking for ReferenceType #1971

Merged
merged 1 commit into from Mar 8, 2023

Conversation

goar5670
Copy link
Contributor

@goar5670 goar5670 commented Mar 6, 2023

provide basic resolve and typechecking for ReferencePattern.

@powerboat9
Copy link
Contributor

@goar5670 the clang format check failed

Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

Seems good to me but lets add a test case for this

gcc/rust/ChangeLog:
	* hir/tree/rust-hir-pattern.h (HIR::ReferencePattern):
	added get_referenced_pattern function.
	* resolve/rust-ast-resolve-pattern.h
	(Resolve::PatternDeclaration): add visit function for
	AST::ReferencePattern
	* typecheck/rust-hir-type-check-pattern.cc
	(Resolver::TypeCheckPattern): add visit function for
	HIR::ReferencePattern

gcc/testsuite/ChangeLog:
	* rust/compile/ref_pattern_fn_param.rs: New test.

Signed-off-by: Mahmoud Mohamed <mahadelr19@gmail.com>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

LGTM

@philberty philberty added this pull request to the merge queue Mar 8, 2023
Merged via the queue into Rust-GCC:master with commit 5bd4b19 Mar 8, 2023
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.

None yet

3 participants