mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
![]() Turns out that we can't always assume that a successful unification of type alias type variables means that those aliases had the same real type from the start. Because type variables may contain unbound type variables and grow during their unification (for example, `[InvalidNumStr]a ~ [ListWasEmpty]b` unify to give `[InvalidNumStr, ListWasEmpty]`), the real type may grow as well. For this reason, continue to explicitly unify alias real types for now. We can get away with not having to do so when the type variable unification causes no changes to the unification tree at all, but we don't have a great way to detect that right now (maybe snapshots?) Closes #2583 |
||
---|---|---|
.. | ||
src | ||
build.rs | ||
Cargo.toml | ||
README.md |
Running our CodeGen tests
Our code generation tests are all in this crate. Feature flags are used to run the tests with a specific backend. For convenience, some aliases are added in .cargo/config
:
[alias]
test-gen-llvm = "test -p test_gen"
test-gen-dev = "test -p test_gen --no-default-features --features gen-dev"
test-gen-wasm = "test -p test_gen --no-default-features --features gen-wasm"
So we can run:
cargo test-gen-llvm
To run the gen tests with the LLVM backend. To filter tests, append a filter like so:
> cargo test-gen-wasm wasm_str::small
Finished test [unoptimized + debuginfo] target(s) in 0.13s
Running src/tests.rs (target/debug/deps/test_gen-b4ad63a9dd50f050)
running 2 tests
test wasm_str::small_str_literal ... ok
test wasm_str::small_str_zeroed_literal ... ok