mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
Handle symbols that shadow ability member definitions
Just add the shadowing symbol for now. We'll handle checking that a specialization's type matches the member's type definition in a later pass, during typechecking.
This commit is contained in:
parent
884d07344e
commit
73bfff699f
7 changed files with 193 additions and 40 deletions
|
@ -2088,6 +2088,13 @@ fn pattern_to_when<'a>(
|
|||
// They should have been replaced with `UnsupportedPattern` during canonicalization
|
||||
unreachable!("refutable pattern {:?} where irrefutable pattern is expected. This should never happen!", pattern.value)
|
||||
}
|
||||
|
||||
AbilityMemberSpecialization { .. } => {
|
||||
unreachable!(
|
||||
"Ability member specialization {:?} should never appear in a when!",
|
||||
pattern.value
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7787,6 +7794,7 @@ fn from_can_pattern_help<'a>(
|
|||
match can_pattern {
|
||||
Underscore => Ok(Pattern::Underscore),
|
||||
Identifier(symbol) => Ok(Pattern::Identifier(*symbol)),
|
||||
AbilityMemberSpecialization { ident, .. } => Ok(Pattern::Identifier(*ident)),
|
||||
IntLiteral(_, precision_var, _, int, _bound) => {
|
||||
match num_argument_to_int_or_float(env.subs, env.target_info, *precision_var, false) {
|
||||
IntOrFloat::Int(precision) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue