-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2107 Switching to let TypeScript parse the generic attribute by wrapping it with an arrow function.
- Loading branch information
1 parent
fc538b6
commit dddedf0
Showing
4 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/svelte2tsx/test/svelte2tsx/samples/generic-attribute-const-modifier/expectedv2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
///<reference types="svelte" /> | ||
;function render<const T extends readonly string[]>() { | ||
|
||
let items: T/*Ωignore_startΩ*/;items = __sveltets_2_any(items);/*Ωignore_endΩ*/; | ||
; | ||
async () => {}; | ||
return { props: {items: items}, slots: {}, events: {} }} | ||
class __sveltets_Render<const T extends readonly string[]> { | ||
props() { | ||
return render<T>().props; | ||
} | ||
events() { | ||
return __sveltets_2_with_any_event(render<T>()).events; | ||
} | ||
slots() { | ||
return render<T>().slots; | ||
} | ||
} | ||
|
||
|
||
import { SvelteComponentTyped as __SvelteComponentTyped__ } from "svelte" | ||
export default class Input__SvelteComponent_<const T extends readonly string[]> extends __SvelteComponentTyped__<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> { | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/svelte2tsx/test/svelte2tsx/samples/generic-attribute-const-modifier/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script lang="ts" generics="const T extends readonly string[]"> | ||
export let items: T; | ||
</script> |