-
Notifications
You must be signed in to change notification settings - Fork 570
Go 1.11 support. #836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've started working on this on The current status is that most of the fundamental functionality is operational. Not all the tests are passing yet, but most are. The tests that are failing are mostly additions to Go 1.11 rather regressions in previous behavior. That includes new tests, and bug fixes/improvements applied during 1.11 cycle that will need to be adapted to GopherJS to get updated stricter tests to pass. The current known failures on Linux (from CI) are:
That work is up next. However, the compiler seems to be largely functional already. Edit: It's functional with |
For go1.11beta3 I am currently getting the following error (using vgo):
Thanks for the hard work! |
I've fixed the
|
Investigating this now. Confirmed it's a regression (in GopherJS 1.11 WIP). Made a smaller reproduce: package main
import (
"fmt"
"go/ast"
"go/doc"
"go/parser"
"go/printer"
"go/token"
"os"
)
func main() {
fset := token.NewFileSet()
f, err := parser.ParseFile(fset, "issue16153.go", src, 0)
if err != nil {
panic(err)
}
apkg := &ast.Package{
Name: "issue16153",
Files: map[string]*ast.File{
"issue16153.go": f,
},
}
doc := doc.New(apkg, "foo/bar/issue16153", 0)
err = printer.Fprint(os.Stdout, fset, doc.Consts[0].Decl)
if err != nil {
panic(err)
}
fmt.Println()
}
const src = `package issue16153
const (
x2 uint8 = 255
Y2
)
` After printing the AST, I can see the difference that's causing this: Might be a reflect bug, so it's great this got caught. |
Investigating it further, I learned that the issue was due to changes to It had this line, which was very suspect: @@ -171,6 +199,7 @@ func (r *reader) filterSpec(spec ast.Spec) bool {
// always keep imports so we can collect them
return true
case *ast.ValueSpec:
+ s.Values = filterExprList(s.Values, ast.IsExported, true)
if len(s.Values) > 0 || s.Type == nil && len(s.Values) == 0 {
// If there are values declared on RHS, just replace the unexported
// identifiers on the LHS with underscore, so that it matches After looking at the source of var s []int
s = s[0:0]
// s is []int(nil) in Go, but []int{} in GopherJS Playground links confirming it: The spec clearly defines this behavior:
(It's quite possible this is a reported issue in GopherJS, but hasn't been resolved yet.) |
I've updated the The |
GopherJS 1.11-1 is now released and available on Blog post: https://medium.com/gopherjs/gopherjs-1-11-1-is-released-7aad12f7e646. Tweet: https://twitter.com/GopherJS/status/1033473977509982208. GopherJS Playground has been updated: https://gopherjs.github.io/playground/#/1pp8a59LAX. Thanks everyone! 🎉 🏄♂️ |
This is an issue to track work to support Go 1.11.
go1.11beta1
has been released today.The text was updated successfully, but these errors were encountered: