mirror of https://github.com/sveltejs/svelte
parent
38e8fb680a
commit
3ebc8bd822
@ -1,40 +1,25 @@
|
|||||||
import type { Snippet } from 'svelte';
|
import type { Snippet } from 'svelte';
|
||||||
|
|
||||||
const return_type: ReturnType<Snippet> = null as any;
|
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const a: Snippet<{ text: string }> = () => {};
|
const a: Snippet<{ text: string }> = () => {};
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const b: Snippet<boolean> = (a, b) => {
|
const b: Snippet<boolean> = (a, b) => {};
|
||||||
return return_type;
|
|
||||||
};
|
|
||||||
// @ts-expect-error
|
|
||||||
const c: Snippet<boolean> = (a: string) => {
|
|
||||||
return return_type;
|
|
||||||
};
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const d: Snippet<boolean> = (a: string, b: number) => {
|
const c: Snippet<boolean> = (a: string) => {};
|
||||||
return return_type;
|
|
||||||
};
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const e: Snippet = (a: string) => {
|
const d: Snippet<boolean> = (a: string, b: number) => {};
|
||||||
return return_type;
|
|
||||||
};
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
|
const e: Snippet = (a: string) => {};
|
||||||
const f: Snippet = (a) => {
|
const f: Snippet = (a) => {
|
||||||
|
// @ts-expect-error
|
||||||
a?.x;
|
a?.x;
|
||||||
return return_type;
|
|
||||||
};
|
};
|
||||||
const g: Snippet<[boolean]> = (a) => {
|
const g: Snippet<[boolean]> = (internals, a) => {
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
a === '';
|
a() === '';
|
||||||
a === true;
|
a() === true;
|
||||||
return return_type;
|
|
||||||
};
|
|
||||||
const h: Snippet<[{ a: true }]> = (a) => {
|
|
||||||
a.a === true;
|
|
||||||
return return_type;
|
|
||||||
};
|
};
|
||||||
const i: Snippet = () => {
|
const h: Snippet<[{ a: true }]> = (internals, a) => {
|
||||||
return return_type;
|
a().a === true;
|
||||||
};
|
};
|
||||||
|
const i: Snippet = () => {};
|
||||||
|
|||||||
Loading…
Reference in new issue