Catch ... errors earlier and in case of error, type-check all
arguments anyway for better type reporting and fewer "declared
but not used" errors.
R=adonovan
CC=golang-dev
https://golang.org/cl/14600043
This requires us to make a copy of (not clobber) the supplied
config, and retain their Import hook separately so that it can
be wrapped by Importer.doImport.
Fixes bug 6562.
R=gri
CC=golang-dev
https://golang.org/cl/14523054
Before: func(any, ...interface{}).
After: func(any, ...any)
They are no longer variadic, so you can't write print(x, y...).
(Recall that print(1) and print(interface{}(1)) behave
differently and that this is useful.)
Fixes bug 6560
R=gri
CC=golang-dev
https://golang.org/cl/14455054
The new method is functionally identical to typeCheck, and
obviates the LoadMainPackage method.
Updated all clients.
Fixes bug 6561.
R=gri
CC=golang-dev
https://golang.org/cl/14494051
Assignments to "comma, ok" expressions on the lhs of an
assignment are not permitted unless we have map index
"comma, ok" expression. Created new operand mode 'mapindex'
to distinguish this case. Renamed mode 'valueok' to the more
commonly used 'commaok' term, which also makes it easier to
distinguish from simply 'value'.
Added corresponding tests.
Fixes a TODO.
R=adonovan
CC=golang-dev
https://golang.org/cl/14526049
- removed support for nil constants from go/exact
- instead define a singleton Nil Object (the nil _value_)
- in assignments, follow more closely spec wording
(pending spec CL 14415043)
- removed use of goto in checker.unary
- cleanup around handling of isRepresentable for
constants, with better error messages
- fix missing checks in checker.convertUntyped
- added isTyped (== !isUntyped) and isInterface predicates
- fixed hasNil predicate: unsafe.Pointer also has nil
- adjusted ssa per adonovan
- implememted types.Implements (wrapper arounfd types.MissingMethod)
- use types.Implements in vet (and fix a bug)
R=adonovan, r
CC=golang-dev
https://golang.org/cl/14438052
This information can be used to specialize such calls, e.g.
- report location of unsound calls (done for reflect.NewAt)
- exploit argument information (done for constant 'dir' parameter to reflect.ChanOf)
+ tests.
R=crawshaw
CC=golang-dev
https://golang.org/cl/14517046
The $GOROOT/tests may print "BUG" on failure but do not
necessarily exit zero, so we must capture their output too.
Details:
- make plan9 use unix's valueToBytes function (now in externals.go)
- direct the target's syscall.Write and print/println built-ins to a new utility, write(). This may capture the output into a global variable.
R=gri, r
CC=golang-dev
https://golang.org/cl/14550044
Fixesgolang/go#6539
The problem happens on my win7,
for example, the path is "/content\\foo.article".
It leads to the wrong link in generated html page.
So I think we should replace all"\\" with "/" in path string at first.
R=golang-dev, dsymonds, mirtchovski, dave, adg, alex.brainman
CC=golang-dev
https://golang.org/cl/14023043
- factor out argument extraction logic
- cleaned up error handling in builtin.go (no need for goto's anymore)
- lots of additional test cases
- various cleanups, better documentation
Fixesgolang/go#5795.
R=adonovan
CC=golang-dev
https://golang.org/cl/14312044
It would be nice to be able to use this package
as a dependency (or other go utilities in the
ecosystem that depend on this package) in
environments which have not (or cannot) for
whatever reason upgraded to newer versions of
golang.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14283043
Not the right approach.
««« original CL description
go.tools/godoc: reverse reversed redirects
Make godoc work again for go spec and memory model doc.
TBR=rsc
CC=golang-dev
https://golang.org/cl/14368043
»»»
R=gri
CC=golang-dev
https://golang.org/cl/14370043
Present the files in lexical order so the output is reproducible
and easier to navigate. Do a little type rearrangement to simplify
things while we're there.
R=adg
CC=golang-dev
https://golang.org/cl/14357043
It was not enough to make /ref/spec work (which it now does),
because some of the docs on golang.org (in particular golang.org/doc)
are pulled from tip, and tip links to /doc/spec now.
Make those "too new" links work by redirecting /doc/spec
back to /ref/spec for now.
TBR=adg
CC=golang-dev
https://golang.org/cl/14348043
The redirect.PrefixHandler redirects "/foo/" to "/foo", which is what
we want in most cases ("/cl/", "/change/", etc) but not here.
So wrap it with a handler that handles "/blog/" explictly.
R=dsymonds
CC=golang-dev
https://golang.org/cl/14326043
Revision f280b8a485fd of the std library changed the
gc export format: anonymous fields may be qualified
with a package.
R=rsc
TBR=rsc
CC=golang-dev
https://golang.org/cl/14312043
`svn update` would fail if the updated files were in the gcc/libgo or gcc/go/gofrontend because unrevisioned versions of those files had been inserted in the last build of gcc.
R=adg, adg
CC=golang-dev
https://golang.org/cl/14299043
Since rev 4c5f46cc7b9d, error messages no longer contain
"file:line:col: " prefixes, so applying stripLocation to them
is incorrect.
Also: add rationale comment to callgraph2.go test.
R=crawshaw
CC=golang-dev
https://golang.org/cl/13888044
Since the Go runtime treats it specially, so must the pointer analysis.
Details:
- Combine object.{val,typ} fields into 'data interface{}'.
It may now hold a string, describing an instrinsically
allocated object such as the command-line args.
- extend Label accordingly; add Label.ReflectType() accessor.
Also: document pointer analysis algorithm classification.
R=crawshaw
CC=golang-dev
https://golang.org/cl/14156043
- permit ERROR markers to be in full or line comments
- don't require ""s in /* ERROR "foo" */
- enable more std tests
- some minor cleanups
R=adonovan
CC=golang-dev
https://golang.org/cl/14169044
In general, if a break or continue label is not found, we don't
know if a correspondingly named label was not declared, was declared
but is not visible, or will be declared (and won't be visible).
Complain about "invalid" rather than "not declared" label.
Added more tests.
R=adonovan
CC=golang-dev
https://golang.org/cl/14149043
Details:
- Warnings are reported as values in Result, not a callback in Config.
- remove TODO to eliminate Print callback. It's better than the alternative.
- remove unused Config.root field.
- hang Result off analysis object (impl. detail)
- reword TODO.
R=crawshaw
CC=golang-dev
https://golang.org/cl/14128043
This CL temporarily removes some preliminary label checks.
They will be implemented completely in a subsequent CL.
R=adonovan
CC=golang-dev
https://golang.org/cl/14055043