Prisma Logo Prisma v0.2.12
Back to Blog & Benchmarks
Type Systems internals 2026-11-28 · Manuel Rubio

From v0.2.9 to v0.2.11: Guarded Refinement, Diagnostics UX, Nine Issues Fixed, and a PropEr Suite for Elixir

What changed between v0.2.9 and v0.2.11—from opaque-preserving guards and readable mismatch paths to closing #17–#25 and property-testing compiled Elixir ASTs

#erlang #elixir #prisma #type-systems #gradual-typing #pplt #proper #testing #diagnostics

In From v0.2.1 to v0.2.9, we focused on polymorphic bounded_fun specs, demand-driven specialization, and making PPLT builds fast on large Elixir projects.

Between v0.2.9 and v0.2.11, the focus shifted to type precision in guards, diagnostic readability, nine community-reported issues (#17–#25), and building a property-based test suite (prop_prisma_elixir) that compiles and runs real Elixir code against Prisma.


1. v0.2.10: Guard Refinement, Opaque Preservation, and Focused Mismatch Paths

Two commits landed around v0.2.10 to tighten precision and make large type mismatches readable:


2. v0.2.11: Resolving Nine GitHub Issues (#17–#25)

v0.2.11 addressed nine issues reported against real Elixir and Erlang projects. A huge thank-you to the community contributor who filed these sharp, reproducible reports (#17–#25, as well as several earlier issues)—that kind of detailed feedback from real-world usage is what turns edge cases into permanent test coverage. Looking at all nine issues together, they fell into three clear buckets:

2.1 Elixir elixir_v1 AST & Struct Clause Ordering (#17, #18, #19, #22)

Because Prisma translates Elixir's elixir_v1 debug info directly rather than relying on abstract_code (which strips macro context metadata), every Elixir special form or sugar not explicitly handled in prisma_elixir:translate_expr/1 fell through to a fallback local call:

2.2 Overloaded Specs and BIF Discrepancy Deduplication (#23, #24)

2.3 Mix Task & PPLT Integrity (#20, #21, #25)


3. Closing the Gap: A PropEr Suite for Compiled Elixir (prop_prisma_elixir)

Looking at #17, #18, #19, and #22 together made one pattern obvious: our existing PropEr suite (prop_prisma_infer and prop_prisma_type) generated Erlang forms, so gaps in prisma_elixir's elixir_v1 translation were only discovered when users hit them in the wild.

Right after v0.2.11, we added test/prop_prisma_elixir.erl, which:

  1. Compiles real Elixir modules in-memory with 'Elixir.Code':compile_string/1.
  2. Executes Mod:run() at runtime and analyzes the compiled .beams with prisma:analyze_beams/2.
  3. Asserts three invariants across Elixir constructs (case, cond, with, for, try/after, receive/after, <<x::size(...)>>, zero-arity remote calls vs. m.k, and struct-vs-map clauses) with both valid and intentionally incompatible @specs:
    • Zero phantom calls (Mod:'try', 'receive', 'for', 'with', 'cond', erlang:size).
    • Runtime return value is a member of inferred_type (prisma_oracle:member/2).
    • gradual_mismatch fires if and only if the @spec is incompatible, with no false discrepancy or dead_code.

On its very first runs, prop_prisma_elixir immediately uncovered two more gaps that are now fixed in v0.2.11 (republished with --replace):

With those fixes in place, the test suite stands at 311/311 EUnit tests and 19/19 PropEr properties (including 100/100 cases in prop_prisma_elixir).


4. Still on the Roadmap

The three longer-term items from our earlier roadmap remain open:

  1. Nominal Types (-nominal, EEP-69 / OTP 28+): Parsed as kind = nominal, still expanded structurally.
  2. Native Records (-record #name{}, EEP-79 / OTP 29+): Not yet extracted or checked.
  3. Value-Correlated Spec Overloads & Formalization: Dispatch correlations like rabbit_ff_controller:run_callback/5 and the standalone TYPESYSTEM.md / Lean 4 / Rocq formalization.