mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
inline function
This commit is contained in:
parent
0f245ba778
commit
c9d422335f
3 changed files with 8 additions and 5 deletions
|
@ -1180,8 +1180,13 @@ fn add_annotation_aliases(
|
|||
// See 3d5a2560057d7f25813112dfa5309956c0f9e6a9 and its
|
||||
// parent commit for the bug this fixed!
|
||||
enum DefReferences {
|
||||
/// A value may not reference itself
|
||||
Value(References),
|
||||
|
||||
/// If the def is a function, different rules apply (it can call itself)
|
||||
Function(References),
|
||||
|
||||
/// An annotation without a body references no other defs
|
||||
AnnotationWithoutBody,
|
||||
}
|
||||
|
||||
|
|
|
@ -182,8 +182,4 @@ impl<'a> Env<'a> {
|
|||
pub fn problem(&mut self, problem: Problem) {
|
||||
self.problems.push(problem)
|
||||
}
|
||||
|
||||
pub fn register_closure(&mut self, symbol: Symbol, references: References) {
|
||||
self.closures.insert(symbol, references);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -699,7 +699,9 @@ pub fn canonicalize_expr<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
env.register_closure(symbol, output.references.clone());
|
||||
// store the references of this function in the Env. This information is used
|
||||
// when we canonicalize a surrounding def (if it exists)
|
||||
env.closures.insert(symbol, output.references.clone());
|
||||
|
||||
let mut captured_symbols: Vec<_> = captured_symbols
|
||||
.into_iter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue