Skip to content

Allow TP to provide compile errors/warnings #294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rojepp opened this issue Mar 27, 2019 · 3 comments
Open

Allow TP to provide compile errors/warnings #294

rojepp opened this issue Mar 27, 2019 · 3 comments

Comments

@rojepp
Copy link

rojepp commented Mar 27, 2019

Description

Feature suggestion: It would be nice if a TP could contribute compile errors and warnings, with a file and a location in the file. For instance, if say the json parser for a json TP fails to parse and gives a line number in its error, we could propagate that info out to the user, with squigglies in the json file even.

Maybe TypeProviderConfig could have a mechanism to allow adding this info?

@dsyme
Copy link
Contributor

dsyme commented Mar 30, 2019

Yes, I agree, providing warnings is important

@smoothdeveloper
Copy link
Contributor

smoothdeveloper commented Mar 30, 2019

related: fsharp/fslang-suggestions#729

@Thorium
Copy link
Member

Thorium commented Apr 9, 2019

Warnings would be nice. Then we could really do dependant types as warnings: TypeProviders "compile" information sources to .NET types. However we have more knowledge on the types that what we really want to use: we want to use normal .NET types to make the usability easy. Compiler warnings could solve this.

Concrete example: a varchar(3) has max length 3 but for .NET usability reasons we don't want to create String3-class. So a string-class with compiler warning "You tried to insert "asdf" to varchar(3)" could be a good compromise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants