Skip to content

MGCA: Avoid code duplication between HIR ty lowering and elsewhere #150621

@BoxyUwU

Description

@BoxyUwU

Currently the HIR ty lowering logic for direct const arguments has a lot of overlap with code elsewhere in the compiler. For example:

  • We have logic in HIR type check for resolving type relative paths, and also logic in HIR ty lowering
  • We have logic in HIR type check for type checking struct expressions, and we have very similar logic in HIR ty lowering for validating that a direct struct expression has the right amount of fields.

I'm not sure what the right way to avoid this code duplication is, but we should fix this before this code duplication becomes something that affects stable code.

Metadata

Metadata

Assignees

Labels

A-technical-debtArea: Internal cleanup workC-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-needs-designThis issue needs exploration and design to see how and if we can fix/implement itF-min_generic_const_args`#![feature(min_generic_const_args)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions