1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

fix(ext/ffi): pointer type can accept null (#13335)

This commit is contained in:
DjDeveloper 2022-01-11 15:01:52 +05:30 committed by GitHub
parent 5680d33dd9
commit a7ea93b978
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -151,7 +151,7 @@ declare namespace Deno {
type StaticForeignFunctionParameter<T> = T extends "void" ? void type StaticForeignFunctionParameter<T> = T extends "void" ? void
: T extends StaticNativeNumberType ? number : T extends StaticNativeNumberType ? number
: T extends "pointer" ? Deno.UnsafePointer | Deno.TypedArray : T extends "pointer" ? Deno.UnsafePointer | Deno.TypedArray | null
: unknown; : unknown;
/** Infers a foreign function parameter list. */ /** Infers a foreign function parameter list. */

View file

@ -86,7 +86,7 @@ remote.symbols.method14(null);
remote.symbols.method14(0); remote.symbols.method14(0);
// @ts-expect-error: Invalid argument // @ts-expect-error: Invalid argument
remote.symbols.method15(null); remote.symbols.method15(0);
remote.symbols.method15(new Uint16Array(1)); remote.symbols.method15(new Uint16Array(1));
remote.symbols.method15({} as Deno.UnsafePointer); remote.symbols.method15({} as Deno.UnsafePointer);