mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Make sure records don't de-generalize function types, fixing ability let-generalization
Closes #3641
This commit is contained in:
parent
ce8c8f7264
commit
f145f29b1b
2 changed files with 11 additions and 16 deletions
|
@ -7255,24 +7255,11 @@ mod solve_expr {
|
|||
# ^
|
||||
"#
|
||||
),
|
||||
// TODO SERIOUS: Let generalization is broken here, and this is NOT correct!!
|
||||
// Two problems:
|
||||
// - 1. `{}` always has its rank adjusted to the toplevel, which forces the rest
|
||||
// of the type to the toplevel, but that is NOT correct here!
|
||||
// - 2. During solving lambda set compaction cannot happen until an entire module
|
||||
// is solved, which forces resolved-but-not-yet-compacted lambdas in
|
||||
// unspecialized lambda sets to pull the rank into a lower, non-generalized
|
||||
// rank. Special-casing for that is a TERRIBLE HACK that interferes very
|
||||
// poorly with (1)
|
||||
//
|
||||
// We are BLOCKED on https://github.com/rtfeldman/roc/issues/3207 to make this work
|
||||
// correctly!
|
||||
// See also https://github.com/rtfeldman/roc/pull/3175, a separate, but similar problem.
|
||||
@r###"
|
||||
Fo#f(7) : Fo -[[f(7)]]-> (b -[[] + b:g(4):1]-> {}) | b has G
|
||||
Go#g(8) : Go -[[g(8)]]-> {}
|
||||
h : Go -[[g(8)]]-> {}
|
||||
Fo#f(7) : Fo -[[f(7)]]-> (Go -[[g(8)]]-> {})
|
||||
h : b -[[] + b:g(4):1]-> {} | b has G
|
||||
Fo#f(7) : Fo -[[f(7)]]-> (b -[[] + b:g(4):1]-> {}) | b has G
|
||||
h : Go -[[g(8)]]-> {}
|
||||
"###
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue