-
Notifications
You must be signed in to change notification settings - Fork 853
Uncaptured locals are not available in closures when debugging #11262
Copy link
Copy link
Open
Labels
Area-Debugstepping, debug points, stacks and morestepping, debug points, stacks and moreFeature ImprovementImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.Theme-Simple-F#A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Milestone
Metadata
Metadata
Assignees
Labels
Area-Debugstepping, debug points, stacks and morestepping, debug points, stacks and moreFeature ImprovementImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.Theme-Simple-F#A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
New
Repro:
let startOfArgs = ...)1on the last line,) so that Signature Help is triggeredNote that there are some locals, and critically you can observe the value of
applicableSpan:Now try to get the source code that matches this span by:
sourceText.GetSubText(applicableSpan)You will observe that
sourceTextdoesn't exist. Indeed, it wasn't even in the locals window.However, note that
sourceTextis a parameter to this method and it is clearly accessible.We are losing debug info on every
do!call in the method.To test this, place a breakpoint on line 89 (
do! Option.guard (methods.Length > 0 ...). When it is broken there, you'll see thatsourceTextis available: