Remove Type::some() — an identity function masquerading as a type constructor - #98
Merged
MidnightDesign merged 1 commit intoJul 23, 2026
Conversation
…tructor Type::some() was a public static factory that returned its argument unchanged. Sitting next to option() (a real Option<T> wrapper) and none() (a real None type), it read as "the Some branch of an Option" but constructed no Some type at all: Type::some(Type::int()) was exactly Type::int(), a silent footgun for calls like isSubtypeOf(). Its only test asserted `Some<T> == T` via the identity behavior, so the equalsCases provider and its testEquals consumer go with it; equals()'s positive path stays covered by testAliasTypeEqualsAliasTarget, and the Some<...> type-parsing path (notEqualsCases) is untouched. TypeConstructor::Some and the parser's resolveSome() stay: they back the Some<T> type syntax that Option<T> builds on. Structural BC break scoped for the 0.3.0 breaking release. Closes #93 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQzPPJxpbn6z2BQ1JYnxoY
MidnightDesign
deleted the
93-remove-typesome-an-identity-function-masquerading-as-a-type-constructor
branch
July 23, 2026 14:26
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.
Problem
Type::some()was a public static factory that returned its argument unchanged:Sitting next to
option()(a realOption<T>wrapper) andnone()(a realNonetype), it read as "the Some branch of an Option" but constructed noSometype at all.Type::some(Type::int())was exactlyType::int(), so calls likex.isSubtypeOf(Type::some(...))behaved nothing like they read — a silent footgun.Someappears nowhere in the README's user-facing type list.Change
Type::some()from the public surface.equalsCasesprovider held a single case,'Some<T> == T', whose whole purpose was to assert the identity behavior being removed; with it gone the provider would be empty, so the provider and itstestEqualsconsumer go together.equals()'s positive path stays covered bytestAliasTypeEqualsAliasTarget, and theSome<...>type-parsing path (notEqualsCases) is untouched.Deliberately left alone
TypeConstructor::Someand the parser'sresolveSome()are legitimate — they back theSome<T>type syntax thatOption<T>builds on. This PR targets only the misleading public factory.BC impact
Structural break (public method removal). Scoped for the 0.3.0 breaking release.
Verification
composer check-deps: no unknown symbolsmaster, 100% MSI): deletion-only change, no mutants generated — passes under--ignore-msi-with-no-mutationsCloses #93
🤖 Generated with Claude Code