-
Notifications
You must be signed in to change notification settings - Fork 1
WIP: Ternary Expression TypeNarrower for Nullables #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mhsdesign
wants to merge
30
commits into
main
Choose a base branch
from
task/simpleNullableHandling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
7efcfd3
TASK: Put domain logic inside constructor of UnionType
mhsdesign 2ffe099
TASK: Simple Nullable Handling
mhsdesign 6293145
TASK: Infer types in arms of ternary
mhsdesign 2a08474
TASK: Revert 7efcfd3cc179443912b5e06d1b913efde3cb5739
mhsdesign 5e4d6ce
TASK: Union test that all members are deduplicated
mhsdesign 5c08a4e
TASK: Union test isNullable and withoutNullable
mhsdesign 8f0ba11
TASK: UnionType rename to containsNull, withoutNull
mhsdesign 8a34ee1
TASK: Introduce TernaryBranchScope
mhsdesign 1b476e5
TASK: Type inference for null comparison in ternary
mhsdesign 57ee20c
TASK: UnionType RequiresAtLeastOneMember
mhsdesign 3487bd9
TASK: TernaryBranchScope introduce static factories and dont throw bo…
mhsdesign 1348ac1
TASK: Make type inference in TernaryBranchScope more explicit
mhsdesign 492e05c
TASK: Adjust naming of $nonNullable to $typeWithoutNull
mhsdesign 0c7061f
TASK: Solve #7 rudimentary
mhsdesign 22df4ba
TASK: Introduce TypeInferrer inspired by phpstan to support future ad…
mhsdesign 0adb4c0
TASK: Cleanup InferredTypes and extract duplicated logic to TypeInfer…
mhsdesign f61b896
TASK: Remove `@phpstan-ignore-next-line` by asserting that an array i…
mhsdesign 6a8bd00
Merge remote-tracking branch 'origin/main' into task/simpleNullableHa…
mhsdesign d835fa5
TASK: UnionType::getIterator use `yield from`
mhsdesign 88c6fd6
TASK: Rename `Inferrer` to `Narrower` and apply further suggestions f…
mhsdesign e0a913a
TASK: `Narrower` handle boolean literal comparisons
mhsdesign aaf6c49
TASK: `Narrower` null comparison against any expression that resolves…
mhsdesign 560c97d
TASK: Add `ExpressionTypeNarrowerTest`
mhsdesign d00a194
TASK: Don't narrow `nullableString === true` as string
mhsdesign 530b155
TASK: Narrow `nullableString && true`
mhsdesign 331cdda
TASK: Correct namespace
mhsdesign bd28d87
Merge remote-tracking branch 'origin' into task/simpleNullableHandling
mhsdesign 1027e16
TASK: Adjust to BinaryOperationNode api change
mhsdesign 884b895
TASK: Apply suggestions from code review
mhsdesign 0121247
TASK: ExpressionTypeNarrower support UnaryOperationNode
mhsdesign File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because one should use the static factories - but I guess this will make unit testing harder … for now fine imo? I like having private constructors at times …
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you've made it
public🧐There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misread the diff 😂 its the 4 day in berlin 😅😂