Syntax error when using anonymous struct in if-statement #2746

Closed
fraenky8 opened this Issue Aug 18, 2016 · 0 comments

Projects

None yet

2 participants

@fraenky8
fraenky8 commented Aug 18, 2016 edited

Plugin Version: 0.12.1795
IDE name and version:
WebStorm 2016.2.2
Build #WS-162.1628.41, built on August 16, 2016
Java version:
JRE: 1.8.0_102-b14 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation
OS name and version:
Windows 7 x64

What are you trying to do?
Using a anonymous struct in if-statement

What would you expect to happen?
no syntax error

What happens?
Syntax error, see attached screenshots

go build, go vet and go fmt running without errros, so it seems valid go-syntax.

you can test it here: https://play.golang.org/p/XATRHPTU1Z

package main

import (
    "fmt"
)

func main() {
    s := struct{ Username, Password string }{
        "User",
        "Password",
    }

    if s != struct{ Username, Password string }{} {
        fmt.Println("yes")
    } else {
        fmt.Println("yes")
    }
}

Attachements / Screenshots

syntaxerror1

syntaxerror3

syntaxerror2

@ignatov ignatov self-assigned this Aug 18, 2016
@ignatov ignatov added a commit that closed this issue Aug 18, 2016
@ignatov ignatov syntax error when using anonymous struct in if-statement, fix #2746
(cherry picked from commit cf6153525597b6bdf1daabfbace230d7581069f4)
7799ff0
@ignatov ignatov closed this in 7799ff0 Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment