Add named enums and exhaustive match - #98
Open
itsfuad wants to merge 5 commits into
Open
Conversation
Parse enum payload schemas, variant literals, is tests, and match statements. Add payload-aware semantic cases, declaration-owned variant symbols, constructor evidence, and shared VariantMake lowering.\n\nCentralize qualified variant path splitting, imported-member diagnostics, and struct/variant field validation so later phases consume one semantic source of truth.
Resolve and typecheck exhaustive match arms through canonical semantic evidence, then build case-labelled CFG edges with definite-init and flow transfer. Reuse shared case lookup and place origins, and lower copyable pattern bindings through existing HIR/MIR variant switches and payload projections.
Add structured variant constants, typed MIR static evidence, LLVM aggregate emission, nested extern rejection, LSP enum tooling, fixtures, and shipped-language documentation. Resolve static types through canonical ABI keys so nominally distinct enums with the same display name cannot collide.\n\nHelpers are limited to recursive constant storage, ABI identity, typed backend aggregate lowering, nested type traversal, and balanced incomplete-source completion contexts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
istests, case-set CFG narrowing, exact-case fields, and alias-aware invalidationmatchwith arm scopes, case edges, definite initialization, ownership transfers, and cleanup evidenceValidation
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.shPEEPER_BIN="$PWD/build/bin/peeper" CCACHE_DISABLE=1 GOCACHE=/tmp/peeper-go-cache go test -count=1 ./x_testgit diff --checkBoundaries
Enum::Variantsyntax and never become types or callable constructors.Point{...}and.{...}Stacked on #97. Parent PRs #87, #88, and #97 remain open and unmerged.
Deferred work: #30, #89, #91, #92, #94, #95, and #96.