-
Notifications
You must be signed in to change notification settings - Fork 158
Bug: Flattening generic type also flattens all generic parameters #233
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
495a6bf
add test
NyxCode 5daeed2
re-implement handeling of generics
NyxCode cab0908
Dependency::from_ty - remove generic params from name
NyxCode d764f5c
expand e2e test
NyxCode 29248b4
adjust failing test
NyxCode 4264c5f
fix optional features
NyxCode 83b9541
fix TS_RS_EXPORT_DIR
NyxCode 61c9692
add test for #70
NyxCode ebfa532
enable test for #214
NyxCode 129b323
remove TODO about race condition - we fixed that with a mutex.
NyxCode 0a68cef
remove TODO about #56 - already fixed
NyxCode 2b5b9a9
remove "limitations" section from readme - both #56 and #70 are fixed
NyxCode 5ab4aa9
Use type_params to simplify capture of Generics' identifiers
escritorio-gustavo 3e31a3a
Add ident method
escritorio-gustavo bae3df8
Add dummy type to allow exporting types that use ToString as a generi…
escritorio-gustavo a693b60
use DerivedTS::ts_name instead of rust_ty
escritorio-gustavo bdb06d4
use TS::ident
escritorio-gustavo b4f6b01
Prefer renaming Enum to using all variants
escritorio-gustavo 6d9a21f
Remove redundant clones
escritorio-gustavo 3354dc7
Remove unused Option
escritorio-gustavo 268742d
Fix inverted condition and separate the two checks
escritorio-gustavo 3606c48
Merge branch 'main' into bug/flatten-generic-enum
escritorio-gustavo 247276a
Remove redundant #[doc(hidden)]
escritorio-gustavo 01615fe
Replace if Some else None with bool::then
escritorio-gustavo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,10 +1,14 @@ | ||
| use ts_rs::TS; | ||
| use dependency1::LibraryType; | ||
| use dependency1::*; | ||
|
|
||
| #[derive(TS)] | ||
| #[ts(export)] | ||
| struct ConsumerType { | ||
| pub ty: LibraryType | ||
| pub ty1: LibraryType1, | ||
| pub ty2_1: LibraryType2<i32>, | ||
| pub ty2_2: LibraryType2<&'static Self>, | ||
| pub ty2_3: LibraryType2<LibraryType2<Box<ConsumerType>>>, | ||
| pub ty2_4: LibraryType2<LibraryType2<LibraryType1>>, | ||
| } | ||
|
|
||
| fn main() {} |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| use ts_rs::TS; | ||
|
|
||
| #[derive(TS)] | ||
| pub struct LibraryType { | ||
| pub struct LibraryType1 { | ||
| pub a: i32 | ||
| } | ||
| } | ||
|
|
||
| #[derive(TS)] | ||
| pub struct LibraryType2<T> { | ||
| pub t: T | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.