mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Validation of opaques during canonicalization
This commit is contained in:
parent
6b53692aac
commit
90de82e295
20 changed files with 546 additions and 132 deletions
|
@ -705,18 +705,19 @@ pub fn canonicalize_expr<'a>(
|
|||
Output::default(),
|
||||
)
|
||||
}
|
||||
ast::Expr::OpaqueRef(name) => {
|
||||
let name_ident = env.ident_ids.get_or_insert(&(*name).into());
|
||||
let symbol = Symbol::new(env.home, name_ident);
|
||||
|
||||
(
|
||||
ast::Expr::OpaqueRef(opaque_ref) => match scope.lookup_opaque_ref(opaque_ref, region) {
|
||||
Ok(name) => (
|
||||
OpaqueRef {
|
||||
name: symbol,
|
||||
name,
|
||||
arguments: vec![],
|
||||
},
|
||||
Output::default(),
|
||||
)
|
||||
}
|
||||
),
|
||||
Err(runtime_error) => {
|
||||
env.problem(Problem::RuntimeError(runtime_error.clone()));
|
||||
(RuntimeError(runtime_error), Output::default())
|
||||
}
|
||||
},
|
||||
ast::Expr::Expect(condition, continuation) => {
|
||||
let mut output = Output::default();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue