Comments (4)
@dawedawe since you contributed to this feature this might be of interest to you
Thanks for the finding, I'll work on it.
from fsharp.
@dawedawe since you contributed to this feature this might be of interest to you
from fsharp.
Example project with a case where the bug occurs , and a slightly different version where the bug does not occur
// Nearly identical code that is flagged by the compiler;
// only difference is using List.Append instead of a list comprehension
Difference is that list expression will use list collector, and will result in something like
let tailOrNull = input.TailOrNull
let headOrDefault = input.HeadOrDefault
let listCollector = ListCollector<t>()
listCollector.AddMany(reverse(tailOrNull))
listCollector.Add(headOrDefault)
listCollector.Close()
But when the analysis happens, it probably thinks it's atomic or something.
from fsharp.
Oh, yeah
[<TailCall>]
let rec recurse (list : list<int>) =
[ yield! recurse list; () ]
Will result in something like (roughly):
DebugPoint((6,8--6,35), App(toList, [Op(Coerce, App(seq, [App(delay, [Lambda([unitVar], App(append, [.., ..]))])]))]))
Whereas
[<TailCall>]
let rec recurse (list : list<int>) =
recurse list; ()
into
Sequential(DebugPoint((7,8--7,20), App(.., [..])), DebugPoint((7,22--7,24), ()))
We analyze the latter correctly as sequential expression and produce the warning, and we end up analysing the former as application and decide that it's tail recursive, which we shouldn't.
from fsharp.
Related Issues (20)
- dotnet fsi crashes with lines longer than terminal width HOT 5
- Inline warning resulting in run time error (NotSupportedException) HOT 2
- An F# or C# shebang executable should use a cached binary on subsequent runs HOT 1
- F# files moved with by dragging HOT 1
- Enable F# Code Metrics and Analysis
- Improve onhover tooltip for visual studio HOT 1
- Support / fix replacing reference (Refactor -> Rename) of F# operator HOT 1
- [Feature request] Support solution view where projects are ordered based on number of dependent projects. HOT 2
- F# - Add Function Dependency Status to Functions/IntelliSense for F# (like C# has) HOT 1
- Internal error when dotting into delegate with 2 or more type parameters
- I'm getting unwanted navigation when holding `Ctrl` and hovering over operators like `&&` or `>`. Not sure if caused by this PR or a bug in VS. HOT 5
- Incorrect TailCall warning on async recursive functions HOT 2
- Allow #ParsedHashDirectives to have argument types other than strings HOT 1
- Provide better github.dev links for updating release notes HOT 5
- [Automated] PRs inserted in VS build main-34924.28
- Making TypeProviders easier: FS3033 needs base exception message HOT 2
- Integral range optimizations in resumable code computation expressions
- [Automated] PRs inserted in VS build main-34927.16
- Cache and reuse full typecheck results between compiler/tooling runs
- GraphBasedChecking fails when exceptions are defined HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsharp.