-
-
Notifications
You must be signed in to change notification settings - Fork 669
feat: add type narrow to support better type check #2352
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
Closed
HerrCai0907
wants to merge
60
commits into
AssemblyScript:main
from
HerrCai0907:feat/add-type-narrow
Closed
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
df38498
feat: add type narrow to support better type check
HerrCai0907 f55e01a
Revert "feat: add type narrow to support better type check"
HerrCai0907 aab3bfd
add narrow map in flow and use narrowedType if available [WIP]
HerrCai0907 5fd12b3
fix: style
HerrCai0907 c623709
update
HerrCai0907 999ce39
add testcase
HerrCai0907 9bfac7e
fix: or operator
HerrCai0907 2ccd59b
rename function
HerrCai0907 3c7d0dd
support logic and / or in condition
HerrCai0907 bbc3fe1
test: add test case for #2359
HerrCai0907 86f7bce
fix: Fix `||` and `&&` will not inherit branch status
HerrCai0907 4ea7f9e
update test
HerrCai0907 58d53a4
distinguish condi kind
HerrCai0907 e6b9291
update
HerrCai0907 a9d22ea
refactory: use class replace map
HerrCai0907 f344b10
Merge branch 'fix/nullable-flag-not-set-after-bool-operator' into fea…
HerrCai0907 53d5811
fix: assign in condition does not reset element type correctly
HerrCai0907 df62468
refactory: clean useless code
HerrCai0907 5cac092
test: add assign in condition testcase
HerrCai0907 67ce5bd
fix: reduce memory usage
HerrCai0907 450d490
refactory: add invertedCondition
HerrCai0907 b0f3aef
test: add unknown condition testcase
HerrCai0907 3ae97bd
test: add assign testcase
HerrCai0907 3277d93
update testcase
HerrCai0907 c5d94fa
Update src/narrow.ts
HerrCai0907 b1ea921
Update src/narrow.ts
HerrCai0907 8979ac8
lazy init narrowedType
HerrCai0907 cecd1a8
Merge branch 'main' into feat/add-type-narrow
HerrCai0907 2abc9a4
refactory: merge nonnull flag and narrowedTypeMap
HerrCai0907 60547ae
Merge branch 'main' into feat/add-type-narrow
HerrCai0907 81a63e3
fix: unused variant
HerrCai0907 6625289
fix bugs
HerrCai0907 5b244a3
fix: split logic for type and nullable
HerrCai0907 403cae8
docs: add comment for function
HerrCai0907 9115a5c
Update src/compiler.ts
HerrCai0907 a01d883
feat: add type infer for `||` operator
HerrCai0907 4824b44
Update src/flow.ts
HerrCai0907 9b23ad2
Update src/narrow.ts
MaxGraey 4ea58aa
revert: testcase update in 2abc9a4a81be4e30c1fb3386e598626406c3f3e5
HerrCai0907 f0763d0
fix: type narrowing only effect for Local
HerrCai0907 71f26aa
update other testcase
HerrCai0907 db96d70
revert `return assignmentExpression;`
HerrCai0907 2506962
replace `if(a == null) a = new expression` with `||`
HerrCai0907 e245743
fix: lint error
HerrCai0907 5d401b8
add more testcases for nullable
HerrCai0907 dc2f28a
rename `conditionalNarrowedType` with `typeNarrowChecker`
HerrCai0907 41d4e4b
refactory testcase
HerrCai0907 265eff1
fix logic or narrow bugs
HerrCai0907 e2256c8
remove `||` assert
HerrCai0907 9af6064
fix: remove default initialized typeNarrowChecker
HerrCai0907 ac12ee8
fix
HerrCai0907 0a0135b
refactory `forkTrueBranch` and `forkFalseBranch`
HerrCai0907 bfc9ed8
refactory type narrow in `inheritBranch`
HerrCai0907 85387c8
test: add initType testcase
HerrCai0907 fb117fa
switch position for `inheritBranch` and `freeScopedLocals`
HerrCai0907 3554be4
copy `narrowedTypes` when `inhertiMutual` inherit 1 flow
HerrCai0907 3edce9d
refacrory `getVariantType`
HerrCai0907 51de90e
Merge branch 'main' into feat/add-type-narrow
HerrCai0907 c11571f
fix merge conflict
HerrCai0907 5ff9408
Merge branch 'main' into feat/add-type-narrow
HerrCai0907 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
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.
Uh oh!
There was an error while loading. Please reload this page.