- Notifications
You must be signed in to change notification settings - Fork825
Commitb4c26d8
Tail recursion warning and attribute, analysis after optimization (#15503)
* Add TailCall attributeMove work of Avi Avni to current sources but use a field in cenv instead of a function parameter to pass around* Adjust error number after merge* add two test cases for type members* Don't try to split empty CurriedArgInfos* Add more member tests* seems like we need to build up the env.mustTailCall set earlier in the traversal to have the content ready when checking members which call each other* Fix an error from migrating the old PR to current sources.* As cenv is mutated in loops, doing "with" copies isn't that great as the failing CI shows.Making isTailCall also mutable is error prone as one has to switch back to orig values in many places.So refactor to use a flag like Avi did.This should fix the side effects (shown by the failing CI) and more tailrec specific tests* update baselines for FSharp.Core to include TailCallAttribute* warn for rec call in binding, still very WIP* - improve check for problematic bindings to tailcall attributed functions- add tests* improve seq support* add language version flag* improve tests a bit* add tests for async expressions* add tests for module rec* Improve handling of ModuleOrNamespaceContents.TMDefDo and extend testing* suppress some invalid warnings by keeping track of ranges that are annotated with [<TailRec>]* fix build* use Stamp instead of LogicalName as the Map key* fix error number after merge* remove TailCall check code from PostInferenceChecks.fs* Add new file TailCallChecks.fs to focus on tail call checks* first steps to remove limits calculations* remove last bits of limits* don't bother with attribute checking here* remove more unneeded code* small optimization* Adjust error number after main merge* add TailCallChecks.fs to .fantomasignore* remove last non-tailrec error reporting from dedicated file* - add fsi file- trim down some more* simplify* Remove resumable checks* remove external handling* remove isInAppExpr* remove returnScope* remove boundTyparNames* remove argVals from env* let's drop quote and reflect, too, for now* remove usesQuotations* get rid of range-based approach, collect TailRec-attributed bindings upfront and just traverse these* fold instead of mutate* format* make tests more challenging* do the TailCall checks during the main traversal* WIP: move TailCallChecks into main3 after optimization* format* let TailCallChecks.fs be formatted* bring over support for TyLambda bodies from other branch* adjust expected errors* fix the doubled error messages* fix seq analysis* cleanup* cover some more rec constructs* remove commented code from tests* Rename the type "IsTailCall" to "TailCall"* model boolean as dedicated type "TailCallReturnType"* remove unused members of type "PermitByRefExpr"* remove unused mustTailCallExprs from env* add comment to explain origin of PermitByRefExpr* First stab at support for continuation-passing-style* - refactor approach for CPS support to be much simpler- more CPS tests* one env ought to be enough for everyone* report time for "TailCall Checks"* clean up unused function args* improve some comments and names* add API docs for TailCall attribute* add xml comment for TailCallChecks.CheckImplFile* Update src/FSharp.Core/prim-types.fsiCo-authored-by: Petr <psfinaki@users.noreply.github.com>* remove some superfluous stuff from CheckLambdas* More detailed comment* extend test with an inner class type* optimize* update xlf* adjust error messages after xlf update* revert white space changes that sneaked in during rebase---------Co-authored-by: Petr <psfinaki@users.noreply.github.com>1 parent5c15a40 commitb4c26d8
File tree
29 files changed
+2031
-0
lines changed- src
- Compiler
- Checking
- Driver
- Facilities
- TypedTree
- xlf
- FSharp.Core
- tests
- FSharp.Compiler.ComponentTests
- ErrorMessages
- FSharp.Core.UnitTests
29 files changed
+2031
-0
lines changedLines changed: 792 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + |
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
| 43 | + | |
43 | 44 |
| |
44 | 45 |
| |
45 | 46 |
| |
| |||
878 | 879 |
| |
879 | 880 |
| |
880 | 881 |
| |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
881 | 890 |
| |
882 | 891 |
| |
883 | 892 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1576 | 1576 |
| |
1577 | 1577 |
| |
1578 | 1578 |
| |
| 1579 | + | |
1579 | 1580 |
| |
1580 | 1581 |
| |
1581 | 1582 |
| |
| |||
1700 | 1701 |
| |
1701 | 1702 |
| |
1702 | 1703 |
| |
| 1704 | + | |
1703 | 1705 |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
| 340 | + | |
| 341 | + | |
340 | 342 |
| |
341 | 343 |
| |
342 | 344 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
| 74 | + | |
74 | 75 |
| |
75 | 76 |
| |
76 | 77 |
| |
| |||
165 | 166 |
| |
166 | 167 |
| |
167 | 168 |
| |
| 169 | + | |
168 | 170 |
| |
169 | 171 |
| |
170 | 172 |
| |
| |||
291 | 293 |
| |
292 | 294 |
| |
293 | 295 |
| |
| 296 | + | |
294 | 297 |
| |
295 | 298 |
| |
296 | 299 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
64 | 65 |
| |
65 | 66 |
| |
66 | 67 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1509 | 1509 |
| |
1510 | 1510 |
| |
1511 | 1511 |
| |
| 1512 | + | |
1512 | 1513 |
| |
1513 | 1514 |
| |
1514 | 1515 |
| |
|
Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
0 commit comments
Comments
(0)