Commit Graph

12813 Commits

Author SHA1 Message Date
Chris Smowton
bbc0f29f16 Restrict getCheckedType to unrestricted records, introduce getSyntacticCheckedType and use that where appropriate 2023-11-30 11:24:05 +00:00
Chris Smowton
29fdd04eb0 Include switch and instanceof binding in Variable.getAnAssignedValue, and test via endsInQuote 2023-11-30 11:24:05 +00:00
Chris Smowton
ef6ea71e43 Revert unnecessary exists statement 2023-11-30 11:24:05 +00:00
Chris Smowton
47e3d7d8a5 Cast back to Object in advance of returning, to ensure the test doesn't mask a shortcoming of type pruning by pruning at the return site 2023-11-30 11:24:05 +00:00
Chris Smowton
f0144d6a3d Expose that case guard test controls its case body 2023-11-30 11:24:04 +00:00
Chris Smowton
da62a04653 Note that binding variables may be casting nodes 2023-11-30 11:24:04 +00:00
Chris Smowton
c11a260369 Note we can't prove certain unreachable callables when 'case null' is present 2023-11-30 11:24:04 +00:00
Chris Smowton
89f7e7f76a autoformat 2023-11-30 11:24:04 +00:00
Chris Smowton
dd41f50fbf Fix uses of ConditionBlock that require a condition expression (not a switch case statement) 2023-11-30 11:24:04 +00:00
Chris Smowton
68fe7efd9e autoformat 2023-11-30 11:24:04 +00:00
Chris Smowton
6b3080ae92 Allow case null, default to be the first switch case
This is consistent with existing treatment of `case null: default:`
2023-11-30 11:24:04 +00:00
Chris Smowton
0b08507033 Document testedBranch 2023-11-30 11:24:04 +00:00
Chris Smowton
ba0a05c804 Add pretty-printing for patterns 2023-11-30 11:24:04 +00:00
Chris Smowton
668f445fb4 Fix switchCaseControls and hasBranchEdge to account for mixed patterns and constant cases 2023-11-30 11:24:04 +00:00
Chris Smowton
c1814408f0 Fix guard basic block for switch cases 2023-11-30 11:24:04 +00:00
Chris Smowton
6583c72c5d Restrict pattern type guards to account for nested record matching failures 2023-11-30 11:24:03 +00:00
Chris Smowton
d40311efe9 Spelling 2023-11-30 11:24:03 +00:00
Chris Smowton
6e868d21bd Make DefaultCase include NullDefaultCase 2023-11-30 11:24:03 +00:00
Chris Smowton
d2ff1baff0 Replace getDefaultOrNullDefaultCase with getDefaultCase 2023-11-30 11:24:03 +00:00
Chris Smowton
0bb051e08c First stab at implementing negative type-test logic for pattern-case 2023-11-30 11:24:03 +00:00
Chris Smowton
8fd4f99a39 Fix autoformat comment translocation 2023-11-30 11:24:03 +00:00
Chris Smowton
b11a17db21 Improve change note 2023-11-30 11:24:03 +00:00
Chris Smowton
d7a517a989 Remove needless test options 2023-11-30 11:24:03 +00:00
Chris Smowton
ab9f2a77e4 Move comments 2023-11-30 11:24:03 +00:00
Chris Smowton
cc373e322f Engineer join order for getLexicallyOrderedRecordField 2023-11-30 11:24:03 +00:00
Chris Smowton
6fb33e0bde Re-re-factor instanceOfGuarded et al 2023-11-30 11:24:03 +00:00
Chris Smowton
06d5233523 Use SwitchCase.getSelectorExpr 2023-11-30 11:24:03 +00:00
Chris Smowton
b731b8d30a Simplify PatternExpr definition 2023-11-30 11:24:02 +00:00
Chris Smowton
3d980b1684 Switch to using VariableAssign for instanceof and switch dataflow 2023-11-30 11:24:02 +00:00
Chris Smowton
176adf4376 Move PatternExpr to correct file 2023-11-30 11:24:02 +00:00
Chris Smowton
8f10d29f68 Typo 2023-11-30 11:24:02 +00:00
Chris Smowton
de2b98f4a1 Fix hasNullCase 2023-11-30 11:24:02 +00:00
Chris Smowton
480781b049 autoformat 2023-11-30 11:24:02 +00:00
Chris Smowton
158f4bff7a Note specific switch bugfix 2023-11-30 11:24:02 +00:00
Chris Smowton
011eb2201e Add test for ObjFlow over binding patterns 2023-11-30 11:24:02 +00:00
Chris Smowton
4cf511e26a Add test for virtual-dispatch flow through binding patterns 2023-11-30 11:24:02 +00:00
Chris Smowton
43c935024a Add test for typeflow propagation through instanceof and pattern-case 2023-11-30 11:24:02 +00:00
Chris Smowton
fa09be0459 Ensure pattern-case and binding-instanceof are covered in all of type, dispatch and object flow 2023-11-30 11:24:02 +00:00
Chris Smowton
88d9caff8c Unused local query: exclude mandatory declarations 2023-11-30 11:24:02 +00:00
Chris Smowton
91774099fa Write-only container query: account for implicitly-initialised variables 2023-11-30 11:24:01 +00:00
Chris Smowton
bb6e04456a Boxed variable query: account for implicit-init variables 2023-11-30 11:24:01 +00:00
Chris Smowton
0e3f6f7873 autoformat 2023-11-30 11:24:01 +00:00
Chris Smowton
9035ba1f30 Fix isImplicitInit; use it in empty-container query 2023-11-30 11:24:01 +00:00
Chris Smowton
7106ec77bc Fix change note 2023-11-30 11:24:01 +00:00
Chris Smowton
2a6e86633d Improve qldoc 2023-11-30 11:24:01 +00:00
Chris Smowton
e5fdf4dd50 Update test expectation 2023-11-30 11:24:01 +00:00
Chris Smowton
a335109a20 Note that instanceof with a record pattern doesn't have a type access 2023-11-30 11:24:01 +00:00
Chris Smowton
11444a3ae7 Rename Pattern to PatternExpr to avoid clashing with Regex::Pattern 2023-11-30 11:24:01 +00:00
Chris Smowton
023615386b Add change note 2023-11-30 11:24:01 +00:00
Chris Smowton
ded8deceaa Add missing qldoc 2023-11-30 11:24:01 +00:00