func processFileAsPkg(code string) (*Package, []*TopLevelStmt, []error) {
	if !strings.HasPrefix(code, "package ") {
		code = "package main\n" + code
	}
	f := NewFile("main.go", code)
	pkg := NewPackage("main", f)
	errs := pkg.ParseAndCheck()
	return pkg, pkg.Files[0].statements, errs
}
Helper for tests. Takes a scrap of code, parses & typechecks it as if it
was a package.
package have
import (
	"fmt"
	"strings"
	"testing"
)
type typeTestCase struct {
	code       string
	shouldPass bool
	typ        string
}