Allow type providers to report warnings to the compiler
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
exercitus vir commented
I also think that this would allow for many more interesting use cases for type providers.
Gustavo Guerra commented
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