From e6f3c8a0b42d1202d1bdfd8180649b23e92748a4 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 2 Jul 2019 14:28:43 -0700 Subject: [PATCH] go/types: add missing test file Change-Id: I36af54691bf757f78612549283e3eea1358dca0e --- src/go/types/testdata/typeinst.go2 | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/go/types/testdata/typeinst.go2 diff --git a/src/go/types/testdata/typeinst.go2 b/src/go/types/testdata/typeinst.go2 new file mode 100644 index 0000000000..fb3b6e31b3 --- /dev/null +++ b/src/go/types/testdata/typeinst.go2 @@ -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?