I suggest we ...

Allow type providers to report warnings to the compiler

11 votes
Vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)
You have left! (?) (thinking…)
Gustavo Guerra shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

This is approved-in-principle for F# 4.x+

A detailed design is needed. I would prefer one that is idiom-based and doesn’t force type providers to use a later FSharp.Core.dll

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 and Core Library Evolution

2 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...
  • Gustavo Guerra commented  ·   ·  Flag as inappropriate

    Maybe if the class that implements ITypeProvider has a public event named "WarningGenerated" or something like that, the compiler could plug into it and listen. It's a bit hack-y, but as there is a canonical implementation of ITypeProvider in TypeProviderForNameSpaces, we could create a method there called "EmitWarning", and hide how it's implemented, so there would not be a requirements for a specific FSharp.Core.
    Unfortunately, I'm not remembering the case I was thinking about that I wanted to generate a warning on. I think it was in CsvProvider, but can't remember exactly

F# Language

Feedback and Knowledge Base