• Russ Cox's avatar
    cmd/gc: make forward declaration in pure Go package an error · 04098d88
    Russ Cox authored
    An error during the compilation can be more precise
    than an error at link time.
    
    For 'func init', the error happens always: you can't forward
    declare an init func because the name gets mangled.
    
    For other funcs, the error happens only with the special
    (and never used by hand) -= flag, which tells 6g the
    package is pure go.
    
    The go command now passes -= for pure Go packages.
    
    Fixes #3705.
    
    R=ken2
    CC=golang-dev
    https://golang.org/cl/6996054
    04098d88
error.go 2.28 KB