Commit 8e2cd28
Fix a bug with nested fundep instances
Previously, when one type would contain an instance of a class and it used that contained instance's instance to supply its own instance of the class, then it would fail to compile.
The issue was that define-instance removes the class constraints before
checking the types of the instance methods. Normally that's not a problem because they're entailed. But fundep-entail% checks for structural similarity, not entailment. To fix it, fundep-entail now skips fundep-entail% for any predicate that was entailed by the environment.
The tests pass, and the commit includes a regression test that failed with the fix removed and passes now.1 parent 5ecce30 commit 8e2cd28
File tree
2 files changed
+32
-2
lines changed- src/typechecker
- tests
2 files changed
+32
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
294 | 293 | | |
295 | 294 | | |
296 | 295 | | |
297 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
0 commit comments