Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
19c75fa
Add TailCall attribute
dawedawe May 25, 2023
536a9c0
Merge branch 'main' into add_tailcall_attr
dawedawe May 30, 2023
d879525
Adjust error number after merge
dawedawe May 30, 2023
8d03745
add two test cases for type members
dawedawe May 30, 2023
77f6b17
Don't try to split empty CurriedArgInfos
dawedawe May 30, 2023
4422b72
Add more member tests
dawedawe May 31, 2023
7acc83b
seems like we need to build up the env.mustTailCall set earlier in th…
dawedawe May 31, 2023
245c11f
Fix an error from migrating the old PR to current sources.
dawedawe May 31, 2023
bf7f174
Merge branch 'main' into add_tailcall_attr
dawedawe May 31, 2023
c0a4a70
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 1, 2023
a4e5eaa
As cenv is mutated in loops, doing "with" copies isn't that great as …
dawedawe Jun 1, 2023
239ab87
update baselines for FSharp.Core to include TailCallAttribute
dawedawe Jun 2, 2023
29e1753
warn for rec call in binding, still very WIP
dawedawe Jun 5, 2023
8d1d045
- improve check for problematic bindings to tailcall attributed funct…
dawedawe Jun 6, 2023
6059282
improve seq support
dawedawe Jun 6, 2023
d073354
add language version flag
dawedawe Jun 6, 2023
21084c8
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 6, 2023
190bda5
improve tests a bit
dawedawe Jun 7, 2023
42f876e
add tests for async expressions
dawedawe Jun 7, 2023
10ab0c2
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 8, 2023
4ce9850
add tests for module rec
dawedawe Jun 8, 2023
adc6b6d
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 12, 2023
6aa4848
Improve handling of ModuleOrNamespaceContents.TMDefDo and extend testing
dawedawe Jun 12, 2023
78839a2
suppress some invalid warnings by keeping track of ranges that are an…
dawedawe Jun 13, 2023
0e3db93
fix build
dawedawe Jun 13, 2023
61cf291
use Stamp instead of LogicalName as the Map key
dawedawe Jun 14, 2023
32d57e3
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 14, 2023
ecc9c64
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 15, 2023
1d9bf6b
fix error number after merge
dawedawe Jun 15, 2023
d44f529
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 20, 2023
d61e04d
small optimization
dawedawe Jun 28, 2023
64c171a
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 28, 2023
96cd925
Merge branch 'add_tailcall_attr' of https://github.com/dawedawe/fshar…
dawedawe Jun 28, 2023
ccdc873
merge fix
dawedawe Jun 28, 2023
a938ee9
adjust error number
dawedawe Jun 28, 2023
2e68157
another merge fix :(
dawedawe Jun 28, 2023
5a3e569
simplify
dawedawe Jun 28, 2023
4901925
Merge branch 'main' into add_tailcall_attr
dawedawe Jun 30, 2023
b94f8ea
get rid of range-based approach, collect TailRec-attributed bindings …
dawedawe Jun 30, 2023
2275a1c
make tests more challenging
dawedawe Jun 30, 2023
a1eaebc
do the TailCall checks during the main traversal
dawedawe Jun 30, 2023
a9d330f
Merge branch 'main' into add_tailcall_attr
dawedawe Jul 3, 2023
8ad9710
don't warn for bindings of partial applications
dawedawe Jul 3, 2023
b71b4bb
- support TyLambda bodies
dawedawe Jul 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
411 changes: 291 additions & 120 deletions src/Compiler/Checking/PostInferenceChecks.fs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,7 @@ featureExtendedStringInterpolation,"Extended string interpolation similar to C#
featureWarningWhenMultipleRecdTypeChoice,"Raises warnings when multiple record type matches were found during name resolution because of overlapping field names."
featureImprovedImpliedArgumentNames,"Improved implied argument names"
featureStrictIndentation,"Raises errors on incorrect indentation, allows better recovery and analysis during editing"
featureChkNotTailRecursive,"Raises warnings if a member or function has the 'TailCall' attribute, but is not being used in a tail recursive way."
3353,fsiInvalidDirective,"Invalid directive '#%s %s'"
3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
Expand Down Expand Up @@ -1699,4 +1700,5 @@ featureInformationalObjInferenceDiagnostic,"Diagnostic 3559 (warn when obj infer
3566,tcMultipleRecdTypeChoice,"Multiple type matches were found:\n%s\nThe type '%s' was used. Due to the overlapping field names\n%s\nconsider using type annotations or change the order of open statements."
3567,parsMissingMemberBody,"Expecting member body"
3568,parsMissingKeyword,"Missing keyword '%s'"
3569,chkNotTailRecursive,"The member or function '%s' has the 'TailCall' attribute, but is not being used in a tail recursive way."
3577,tcOverrideUsesMultipleArgumentsInsteadOfTuple,"This override takes a tuple instead of multiple arguments. Try to add an additional layer of parentheses at the method definition (e.g. 'member _.Foo((x, y))'), or remove parentheses at the abstract method declaration (e.g. 'abstract member Foo: 'a * 'b -> 'c')."
3 changes: 3 additions & 0 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type LanguageFeature =
| WarningWhenMultipleRecdTypeChoice
| ImprovedImpliedArgumentNames
| DiagnosticForObjInference
| WarningWhenTailRecAttributeButNonTailRecUsage

/// LanguageVersion management
type LanguageVersion(versionText) =
Expand Down Expand Up @@ -165,6 +166,7 @@ type LanguageVersion(versionText) =
LanguageFeature.ImprovedImpliedArgumentNames, previewVersion
LanguageFeature.DiagnosticForObjInference, previewVersion
LanguageFeature.StrictIndentation, previewVersion
LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, previewVersion

]

Expand Down Expand Up @@ -291,6 +293,7 @@ type LanguageVersion(versionText) =
| LanguageFeature.ImprovedImpliedArgumentNames -> FSComp.SR.featureImprovedImpliedArgumentNames ()
| LanguageFeature.DiagnosticForObjInference -> FSComp.SR.featureInformationalObjInferenceDiagnostic ()
| LanguageFeature.StrictIndentation -> FSComp.SR.featureStrictIndentation ()
| LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage -> FSComp.SR.featureChkNotTailRecursive ()

/// Get a version string associated with the given feature.
static member GetFeatureVersionString feature =
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type LanguageFeature =
| WarningWhenMultipleRecdTypeChoice
| ImprovedImpliedArgumentNames
| DiagnosticForObjInference
| WarningWhenTailRecAttributeButNonTailRecUsage

/// LanguageVersion management
type LanguageVersion =
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/TypedTree/TcGlobals.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1509,6 +1509,7 @@ type TcGlobals(
member val attrib_CompilerFeatureRequiredAttribute = findSysAttrib "System.Runtime.CompilerServices.CompilerFeatureRequiredAttribute"
member val attrib_SetsRequiredMembersAttribute = findSysAttrib "System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute"
member val attrib_RequiredMemberAttribute = findSysAttrib "System.Runtime.CompilerServices.RequiredMemberAttribute"
member val attrib_TailCallAttribute = mk_MFCore_attrib "TailCallAttribute"

member g.improveType tcref tinst = improveTy tcref tinst

Expand Down
10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compiler/xlf/FSComp.txt.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading