-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
1.9.0 Deno.connect() types the connection to Conn<NetAddr> making code incompatible #10200
Comments
Obviously, the backward and forwards solution is |
@aricart could you provide example of code that got broken? |
Sorry - Deno.startTls changed signature, so code as below, will fail to compile in 1.9.0
|
error: TS2345 [ERROR]: Argument of type 'Conn<Addr>' is not assignable to parameter of type 'Conn<NetAddr>'.
Type 'Addr' is not assignable to type 'NetAddr'.
Type 'UnixAddr' is missing the following properties from type 'NetAddr': hostname, port
conn, Pacifying it on 1.9.0 by specifying the |
Doing this: const hostname = "connect.ngs.global";
let conn = await Deno.connect({ hostname: hostname, port: 4222 });
// other stuff happening here after detecting the server supports TLS
conn = await Deno.startTls(
conn,
{ hostname: hostname },
);
console.log("connected"); Fixes it under Deno 1.9. Is that not acceptable? |
When declared as a field in a class, as it is used by me, it doesn't. The type is declared and the generics breaks it for 1.9.0, and if I can get it it is broken for previous versions... |
I think #10012 wasn't breaking with the above example if we had set default of type parameter to
|
Previous versions of deno had non-generic
Conn
. This breaks libraries that work perfectly with any version of deno.The text was updated successfully, but these errors were encountered: