Skip to content
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

investigate if fs0064 error message can be tailored #16871

Open
smoothdeveloper opened this issue Mar 13, 2024 · 1 comment
Open

investigate if fs0064 error message can be tailored #16871

smoothdeveloper opened this issue Mar 13, 2024 · 1 comment

Comments

@smoothdeveloper
Copy link
Contributor

reported by jurasiks on the discord

type Paginator(source: ResizeArray<'T>, currentPage: int, pageSize: int) =
  member x.A() = ()

FS0064 This construct causes code to be less generic than indicated by the type annotations. The type variable 'T has been constrained to be type 'obj'.

I know this message can show up in various circumstances, in this case Paginator<'T> needs to be the type name.

For this special case, we could suffix the error message with:

Consider adding the generic type parameter 'T to the type name: Paginator<'T>

or a variation that doesn't quote the symbols, but still guides the user, if quoting symbols is not trivial.

related: #1103

@vzarytovskii
Copy link
Member

It'll probably a good use case for analyser (I.e. it doesn't have to run in process in compiler).

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

No branches or pull requests

3 participants