Skip to content

Add shared tagged variant core - #88

Merged
itsfuad merged 3 commits into
mainfrom
feature/tagged-variant-core
Aug 25, 2026
Merged

itsfuad merged 3 commits into
mainfrom
feature/tagged-variant-core

Conversation

@itsfuad

@itsfuad itsfuad commented Aug 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • lower optionals and future enums through one tagged-variant descriptor and IR operation family
  • replace optional-specific HIR, MIR, place, flow, and LLVM machinery with case-aware variant operations
  • preserve ?T/none, optional ownership rules, and exact tagged optional ABI
  • add exhaustive variant switching, typed payload slots, active-case drops, and declaration-owned nominal identity
  • preserve issue Add optional narrowing and payload access #28 narrowing behavior, including alias invalidation and eager boolean evaluation

Validation

  • CCACHE_DISABLE=1 GOCACHE=/tmp/peeper-go-cache go test -count=1 ./...
  • CCACHE_DISABLE=1 GOCACHE=/tmp/peeper-go-cache go vet ./...
  • CCACHE_DISABLE=1 GOCACHE=/tmp/peeper-go-cache go test -race -count=1 ./...
  • CCACHE_DISABLE=1 GOCACHE=/tmp/peeper-go-cache bash scripts/build.sh
  • PEEPER_BIN="$PWD/build/bin/peeper" CCACHE_DISABLE=1 GOCACHE=/tmp/peeper-go-cache go test -count=1 ./x_test
  • git diff --check

Boundaries

  • no public enum construction or matching syntax in this PR
  • general named-type applications follow in a separate stacked PR
  • compact union payload storage remains deferred
  • optional niche layout remains Add optional niche layouts #30

Stacked on #87. Does not merge or close #28.

Cleanup audit

  • Replaced recursive named-type placeholders with reserved/complete runtime identities.
  • Added cached recursive LLVM identified layouts, reusable drop helpers, cycle-safe property queries, and incomplete-shell diagnostics.
  • Added recursive struct/variant layout and drop coverage on i386 and amd64.
  • Owning-branch commit: bb3e840; includes forward merge of Add optional narrowing and payload access #87.

@itsfuad itsfuad moved this from Todo to In Progress in Peeper Roadmap Aug 23, 2026
…-core

# Conflicts:
#	internal/semantics/place/origin.go
#	internal/semantics/typechecker/flow.go
#	x_test/runtime_optional_narrowing/src/main.peep
Reserve named IR descriptors before lowering child types, emit identified LLVM layouts, and reuse private drop helpers for recursive ownership graphs.

Delete TypeNamed fallback, preserve optional and tagged-enum ABI, and cover valid pointer recursion plus invalid by-value recursion across IR, LLVM, and source fixtures.
@itsfuad
itsfuad changed the base branch from feature/optional-narrowing to main August 25, 2026 17:29
@itsfuad
itsfuad merged commit 4560c5f into main Aug 25, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Peeper Roadmap Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add optional narrowing and payload access

1 participant