question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
vzarytovskiicommented, Nov 19, 2022

I don’t think that should’ve been closed, since it’s not exactly a codelens langservice related one

0reactions
alfonsogarciacarocommented, Nov 23, 2022

@psfinaki No worries! The screenshot was indeed confusing 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript generic's type inference fails if generic is used ...
So for some reason TypeScript can't infer the string type if it's used in a function argument. Why is this? typescript · generics...
Read more >
typescript - Inference of generic type argument of class fails ...
typescript - Inference of generic type argument of class fails depending on properties on that class - Stack Overflow.
Read more >
Type Inference - Learning the Java Language
Type inference is a Java compiler's ability to look at each method invocation and corresponding declaration to determine the type argument (or arguments)...
Read more >
Support for type hints — Python 3.11.4 documentation
A generic type can have any number of type variables. All varieties of TypeVar are permissible as parameters for a generic type: from...
Read more >
Essential C#: Generic Methods
To declare a generic method, you specify the generic type parameters the same way you do for generic types: Add the type parameter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found