mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Add a bit to mark syntactically-generalizable types
This commit is contained in:
parent
3b0e2429e6
commit
bcfb258db8
3 changed files with 130 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::expr::{constrain_def_make_constraint, constrain_def_pattern, Env};
|
||||
use roc_can::abilities::{PendingAbilitiesStore, PendingMemberType};
|
||||
use roc_can::constraint::{Constraint, Constraints};
|
||||
use roc_can::constraint::{Constraint, Constraints, Generalizable};
|
||||
use roc_can::expected::Expected;
|
||||
use roc_can::expr::Declarations;
|
||||
use roc_can::pattern::Pattern;
|
||||
|
@ -76,6 +76,7 @@ fn constrain_symbols_from_requires(
|
|||
Constraint::True,
|
||||
constraint,
|
||||
def_pattern_state,
|
||||
Generalizable(true),
|
||||
)
|
||||
} else {
|
||||
// Otherwise, this symbol comes from an app module - we want to check that the type
|
||||
|
@ -158,6 +159,8 @@ pub fn frontload_ability_constraints(
|
|||
Constraint::True,
|
||||
constraint,
|
||||
def_pattern_state,
|
||||
// Ability signatures can always be generalized since they're prototypical
|
||||
Generalizable(true),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue