compiler: fix type names for generic named structs

Without this change, the compiler would probably have worked just fine
but the generated types would look odd.

You can see in the test case that it now doesn't use `main.Point` but
rather the correct `main.Poin[float32]` etc.
This commit is contained in:
Ayke van Laethem
2022-07-28 13:33:00 +02:00
committed by Ron Evans
parent 5078ce382d
commit 70c52ef1b4
3 changed files with 158 additions and 42 deletions
+3
View File
@@ -18,4 +18,7 @@ func Add[T Coord](a, b Point[T]) Point[T] {
func main() {
var af, bf Point[float32]
Add(af, bf)
var ai, bi Point[int]
Add(ai, bi)
}