compiler: add support for type parameters (aka generics)

...that was surprisingly easy.
This commit is contained in:
Ayke van Laethem
2022-06-11 16:25:34 +02:00
committed by Ron Evans
parent 283fed16a5
commit bb65c5ce2b
11 changed files with 83 additions and 17 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ import (
//
// The program must already be parsed and type-checked with the .Parse() method.
func (p *Program) LoadSSA() *ssa.Program {
prog := ssa.NewProgram(p.fset, ssa.SanityCheckFunctions|ssa.BareInits|ssa.GlobalDebug)
prog := ssa.NewProgram(p.fset, ssa.SanityCheckFunctions|ssa.BareInits|ssa.GlobalDebug|ssa.InstantiateGenerics)
for _, pkg := range p.sorted {
prog.CreatePackage(pkg.Pkg, pkg.Files, &pkg.info, true)