go/types: add missing test file

Change-Id: I36af54691bf757f78612549283e3eea1358dca0e
This commit is contained in:
Robert Griesemer 2019-07-02 14:28:43 -07:00
parent fa30b485bc
commit e6f3c8a0b4
1 changed files with 36 additions and 0 deletions

36
src/go/types/testdata/typeinst.go2 vendored Normal file
View File

@ -0,0 +1,36 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package p
type myInt int
// Parametrized type declarations
type T1(type P) P
type T2(type P) struct {
f P
g int // int should still be in scope chain
}
type List(type P) []P
type A1(type P) P
type A2(type P) struct {
f P
g myInt // myInt should still be in scope chain
}
// Parametrized type instantiations
type _ T1 /* ERROR not a type */ (int) // TODO fix this
// TODO
// think about instantiated types (they are defined types unless alias)
// need type map
// type map maps to unique name found in scopes?