dotnet / dotnet/fsharp

Type inference assigns name to method generic args that conflict with type generic args

Open
#13,062 7 comments 0 reactions 0 assignees View on GitHub
Area-FCS Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

This causes problems when resolving inlined expressions in Fable. For example, in the image below, FCS tells Fable there are two generic args for RouteBuilder, both named `a` and when inlining the code, Fable incorrectly assumes `typeof<'a>.Name` is "String" \. See https://github.com/fable-compiler/repl/issues/152

![image](https://user-images.githubusercontent.com/8275461/165702482-5109e4ff-f2e1-42e2-9eb6-b613de94a831.png)

Is this intended or cannot easily be fixed? It'd be very helpful to work on the assumption all generic arguments have unique names.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.