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
Typechecking breaks on class method with generic args #376
Typechecking breaks on class method with generic args #376
Comments
Whoops, that is indeed a bug! |
This seems to be caused by the interaction of spread + overload, not the generics. We'll fix this. |
It is caused by all of these things. If you remove the generics, there is no type error. Also if you move the generic from the class definition to the function definition, there is no type error. Thanks for looking into it :) |
@lucacasonato @dsherret this is not fixed in Deno 1.42.3 but it did get a new error message:
Notice again that the implementation details are wrong. |
Will go out in a canary release later today hopefully. |
Hi :)
I believe I have found a very specifig bug in the JSR typechecker. If you define a class with a generic, then use the generic as the spread of arguments in a method and in an overload for the method, JSR will fail to understand the types and generate a type error.
Minimal reproduction
Create a Deno project with two files:
main.ts
deno.json
Then run:
You will see the following error:
Notice that the implementation signature shown in the error is completely wrong. We do not have only a single parameter and it is not of type
any
.This is on Deno 1.42.1 (latest) and JSR 0.12.1 (latest). This code runs perfectly fine on Deno and
deno lint
does not produce errors, so I am guessing that this is a bug in JSR.This is currently blocking me from publishing my library to JSR.
The text was updated successfully, but these errors were encountered: