-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare a new release of gopatch with a fix for #54. This will release a binary compiled against Go 1.18, so it will be able to parse generics syntax. Verify that we're able to parse generics syntax with two new integration tests.
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Test that we can parse generic function instantiation in patches. | ||
|
||
-- foo_to_bar.patch -- | ||
@@ | ||
var T, v expression | ||
@@ | ||
-foo[T](v) | ||
+bar[T](v) | ||
|
||
-- a.in.go -- | ||
package a | ||
|
||
func baz() { | ||
foo[int](42) | ||
foo[[]byte]([]byte("hello")) | ||
foo[List[int]](nil) | ||
} | ||
|
||
-- a.out.go -- | ||
package a | ||
|
||
func baz() { | ||
bar[int](42) | ||
bar[[]byte]([]byte("hello")) | ||
bar[List[int]](nil) | ||
} |
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,34 @@ | ||
Test that we can parse generics syntax in source files. | ||
|
||
-- foo_to_bar.patch -- | ||
@@ | ||
@@ | ||
-foo | ||
+bar | ||
|
||
-- a.in.go -- | ||
package a | ||
|
||
import "fmt" | ||
|
||
func foo[T any](x T) { | ||
fmt.Println(x) | ||
} | ||
|
||
func baz() { | ||
foo[int](42) | ||
} | ||
|
||
-- a.out.go -- | ||
package a | ||
|
||
import "fmt" | ||
|
||
func bar[T any](x T) { | ||
fmt.Println(x) | ||
} | ||
|
||
func baz() { | ||
bar[int](42) | ||
} | ||
|