Consider the following code:
[<EntryPoint>]
let main (args: string []) =
let rec main time =
let newTime = time + 2 // place a breakpoint at this line
main newTime
main 0
I am not able to place a breakpoint at the marked line. I meet such problems quite often when using recursive functions and it really makes me not to use them. Is there any simple solution for that?
EDIT: I create a brand new solution and my build command looks like:
‘—— Build started: Project: ConsoleApplication4, Configuration: Debug x86 ——
C:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe -o:obj\x86\Debug\ConsoleApplication4.exe -g –debug:full –noframework –define:DEBUG –define:TRACE –doc:bin\Debug\ConsoleApplication4.XML –optimize- –tailcalls- –platform:x86 -r:”C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll” -r:”C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Client\mscorlib.dll” -r:”C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Client\System.Core.dll” -r:”C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Client\System.dll” -r:”C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Client\System.Numerics.dll” –target:exe –warn:3 –warnaserror:76 –vserrors –LCID:1033 –utf8output –fullpaths –flaterrors “C:\Users\olsv\AppData\Local\Temp.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.fs” Program.fs
ConsoleApplication4 -> d:\olsv\documents\visual studio 2010\Projects\ConsoleApplication4\ConsoleApplication4\bin\Debug\ConsoleApplication4.exe
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========’
So it looks like, that it is a bug. I have already reported it to the F# team. So lets hope that they will fix it soon!