go/types: add README describing the state of this prototype

Change-Id: I9c994be7600ed969064cf49e8edcbe431f1b7242
This commit is contained in:
Robert Griesemer 2019-07-22 16:10:07 -07:00
parent e2ccf6356b
commit 025f8ad924
1 changed files with 42 additions and 0 deletions

42
src/go/types/README Normal file
View File

@ -0,0 +1,42 @@
This version of go/types (and related go/*) libraries contains the changes
to type-check generic code as outlined in the latest contracts proposal, as
presented by Ian Taylor at GopherCon 2019.
NOTE: THIS IS A PROTOTYPE. NOT EVERYTHING IS IMPLEMENTED. THERE ARE BUGS.
Specifically, the following pieces are missing from type-checking or lead
to unexpected behavior:
- Importing of packages with type parameters or contracts.
- Type-checking of contracts and type parameter lists with contracts.
- Alias type names with type parameters.
The following is "working" (as in passes simple tests):
- Parsing of parameterized types and functions.
- Parsing of contract declarations.
- Declaration and use of parameterized types without contracts.
- Declaration and use (calls) of parameterized functions without
contracts, including type inference from function arguments.
The changes/CLs of this protoype should not be considered exemplary or
final code. This is a prototype after all. See the disclaimer above.
To play with this prototype:
- Cherry-pick this CL on top of tip:
git fetch "https://go.googlesource.com/go" ... && git cherry-pick FETCH_HEAD
(replace the ... with the respective information from Gerrit's CL page)
- Build the gotype command:
go install go/types/gotype.go
- Run it against a test case (assuming gotype was installed in a location that
is in your $PATH):
gotype example.go2
See also `gotype -h` for more information.