mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
update tests
This commit is contained in:
parent
df8ab829a6
commit
7731ab38d1
6 changed files with 38 additions and 11 deletions
|
@ -789,13 +789,19 @@ fn canonicalize_pending_def<'a>(
|
|||
|
||||
let arity = typ.arity();
|
||||
|
||||
let def_symbol = match &loc_can_pattern.value {
|
||||
Pattern::Identifier(symbol) => *symbol,
|
||||
_ => panic!("standalone annotations must be on identifiers"),
|
||||
let problem = match &loc_can_pattern.value {
|
||||
Pattern::Identifier(symbol) => RuntimeError::NoImplementationNamed {
|
||||
def_symbol: *symbol,
|
||||
},
|
||||
Pattern::Shadowed(region, loc_ident) => RuntimeError::Shadowing {
|
||||
original_region: *region,
|
||||
shadow: loc_ident.clone(),
|
||||
},
|
||||
_ => RuntimeError::NoImplementation,
|
||||
};
|
||||
|
||||
// Fabricate a body for this annotation, that will error at runtime
|
||||
let value = Expr::RuntimeError(RuntimeError::NoImplementation(def_symbol));
|
||||
let value = Expr::RuntimeError(problem);
|
||||
let is_closure = arity > 0;
|
||||
let loc_can_expr = if !is_closure {
|
||||
Located {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue