Skip to content

Commit 03bfbcc

Browse files
authored
(feat) Type Inference Bounds (#73)
### quick overview This PR is the next step for type inference in our DSL, and follows #72 . To solve the constraints, we need two core functions: `greatest_lower_bound` and `least_upper_bound`. - The least upper bound is the most specific type that is a supertype of both input types. - The greatest lower bound is the most general type that is a subtype of both input types. See tests for examples. Furthermore, some code in `types.rs` was broken, but is now fixed. - Map key was not contravariant, but covariant. - `T` was not a subtype of `Optional[T]`. ### next steps Writing the solver is the next and final step for practical type inference. We would still need to handle `Generics` properly, and propagate `Costed`/`Stored`.
1 parent 665f98b commit 03bfbcc

File tree

5 files changed

+1790
-12
lines changed

5 files changed

+1790
-12
lines changed

optd-dsl/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ futures = "0.3.31"
2323
ordered-float = "5.0.0"
2424

2525
[dev-dependencies]
26-
tokio = { version = "1.44.2", features = ["macros"] }
26+
tokio = { version = "1.44.2", features = ["macros", "rt-multi-thread", "test-util"] }

0 commit comments

Comments
 (0)