-
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.
Merge pull request #255 from TheSpiritXIII/parse-generics
Support parsing type parameters
- Loading branch information
Showing
7 changed files
with
323 additions
and
1 deletion.
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
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,12 @@ | ||
package foo | ||
|
||
// Blah is a test. | ||
// A test, I tell you. | ||
type Blah struct { | ||
// A is the first field. | ||
A int64 `json:"a"` | ||
|
||
// B is the second field. | ||
// Multiline comments work. | ||
B string `json:"b"` | ||
} |
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,10 @@ | ||
package foo | ||
|
||
type Blah[T any, U any, V any] struct { | ||
// V1 is the first field. | ||
V1 T `json:"v1"` | ||
// V2 is the second field. | ||
V2 U `json:"v2"` | ||
// V3 is the third field. | ||
V3 V `json:"v3"` | ||
} |
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,10 @@ | ||
package foo | ||
|
||
type DeepCopyable[T any] interface { | ||
DeepCopy() T | ||
} | ||
|
||
type Blah[T DeepCopyable[T]] struct { | ||
// V is the first field. | ||
V T `json:"v"` | ||
} |
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,6 @@ | ||
package foo | ||
|
||
type Blah[T any] struct { | ||
// V is the first field. | ||
V T `json:"v"` | ||
} |
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