I suggest we ...

Allow TypeProviders to supply location with errors

When a custom type provider fails, the type provider will typically throw, there is not much else to do.

I suggest to add the ability to add an error location when something fails. This would allow to pinpoint with squigglies where the error is in ie json/sql/whatever.

Perhaps the simplest non-breaking implementation would be to add a known exception type that contains a file location and a range. So the TP still just throws, but adds this information where possible.

6 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Robert Jeppesen shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Approved in principle for F# 4.0 (or later, depending), along with “allow type providers to report warnings”. subject to a suitable implementation being submitted. Both are entirely reasonable

Implementations of approved language design items can now be submitted as pull requests to the appropriate branch of http://github.com/Microsoft/visualfsharp. See http://fsharp.github.io/2014/06/18/fsharp-contributions.html for information on contributing to the F# language and core library.

Don Syme, F# Language/Library evolution

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

F# Language

Feedback and Knowledge Base