mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
add Store constraint that does not report errors
This commit is contained in:
parent
75d18eb8ba
commit
bde82c3bb6
10 changed files with 109 additions and 26 deletions
|
@ -244,6 +244,34 @@ fn solve(
|
|||
}
|
||||
}
|
||||
}
|
||||
Store(source, target, _filename, _linenr) => {
|
||||
// a special version of Eq that is used to store types in the AST.
|
||||
// IT DOES NOT REPORT ERRORS!
|
||||
let actual = type_to_var(subs, rank, pools, cached_aliases, source);
|
||||
let target = *target;
|
||||
|
||||
match unify(subs, actual, target) {
|
||||
Success(vars) => {
|
||||
introduce(subs, rank, pools, &vars);
|
||||
|
||||
state
|
||||
}
|
||||
Failure(vars, _actual_type, _expected_type) => {
|
||||
introduce(subs, rank, pools, &vars);
|
||||
|
||||
// ERROR NOT REPORTED
|
||||
|
||||
state
|
||||
}
|
||||
BadType(vars, _problem) => {
|
||||
introduce(subs, rank, pools, &vars);
|
||||
|
||||
// ERROR NOT REPORTED
|
||||
|
||||
state
|
||||
}
|
||||
}
|
||||
}
|
||||
Lookup(symbol, expectation, region) => {
|
||||
let var = *env.vars_by_symbol.get(&symbol).unwrap_or_else(|| {
|
||||
// TODO Instead of panicking, solve this as True and record
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue