-
Notifications
You must be signed in to change notification settings - Fork 833
Allow usage of [<TailCall>] with older FSharp.Core package versions #16373
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bae08ee
allow the TailCall attribute to be defined outside of FSharp.Core by …
dawedawe efde7e7
check the FullName to make sure it's in the FSharp.Core namespace
dawedawe 5d4c711
Merge branch 'main' into alt_tailcall_attr
dawedawe e85b80d
add changelog entry
dawedawe 8f218d2
add PR number to changelog entry
dawedawe 1ce4cde
- remove member attrib_TailCallAttribute from TcGlobals
dawedawe c8db4c9
Merge branch 'main' into alt_tailcall_attr
dawedawe 7d49363
Merge branch 'main' into alt_tailcall_attr
dawedawe 1b41204
Update tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAtt…
dawedawe ae0d763
Merge branch 'main' into alt_tailcall_attr
dawedawe 0168104
remote "withLangVersionPreview" from test for self-defined attribute
dawedawe 6226e96
add sample project to demonstrate
dawedawe 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
6 changes: 6 additions & 0 deletions
6
tests/projects/misc/SelfDefinedTailCallAttribute/Attribute.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| module Microsoft.FSharp.Core | ||
|
|
||
| open System | ||
|
|
||
| [<AttributeUsage(AttributeTargets.Method)>] | ||
| type TailCallAttribute() = inherit Attribute() |
13 changes: 13 additions & 0 deletions
13
tests/projects/misc/SelfDefinedTailCallAttribute/Program.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| namespace N | ||
|
|
||
| module M = | ||
|
|
||
| open Microsoft.FSharp.Core | ||
|
|
||
| [<TailCall>] | ||
| let rec f x = 1 + f x | ||
|
|
||
| [<EntryPoint>] | ||
| let main argv = | ||
| printfn "Hello from F#" | ||
| 0 |
20 changes: 20 additions & 0 deletions
20
tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net6.0</TargetFramework> | ||
| <DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference> | ||
| <LangVersion>preview</LangVersion> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <DotnetFscCompilerPath>$(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll</DotnetFscCompilerPath> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="Attribute.fs" /> | ||
| <Compile Include="Program.fs" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="FSharp.Core" Version="6.0.7" /> | ||
| </ItemGroup> | ||
| </Project> |
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.