]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/types: remove anyBroke
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 22 Mar 2022 18:25:45 +0000 (01:25 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 23 Mar 2022 19:31:43 +0000 (19:31 +0000)
anyBroke now always return false, we can get rid of it.

Updates #51691

Change-Id: Idab5bc9f9f222cc63e50bdde2b23b9404a4bd74e
Reviewed-on: https://go-review.googlesource.com/c/go/+/394557
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/compile/internal/types/type.go

index 5c5ed8a50028e96d22dfa96368508c159d2aacec..e3bfc2410827c075f65c2b58de3761f69d34eff0 100644 (file)
@@ -1853,9 +1853,6 @@ func NewInterface(pkg *Pkg, methods []*Field, implicit bool) *Type {
                        break
                }
        }
-       if anyBroke(methods) {
-               base.Fatalf("type contain broken method: %v", methods)
-       }
        t.extra.(*Interface).pkg = pkg
        t.extra.(*Interface).implicit = implicit
        return t
@@ -1994,9 +1991,6 @@ func NewSignature(pkg *Pkg, recv *Field, tparams, params, results []*Field) *Typ
 func NewStruct(pkg *Pkg, fields []*Field) *Type {
        t := newType(TSTRUCT)
        t.SetFields(fields)
-       if anyBroke(fields) {
-               base.Fatalf("struct contains broken field: %v", fields)
-       }
        t.extra.(*Struct).pkg = pkg
        if fieldsHasTParam(fields) {
                t.SetHasTParam(true)
@@ -2007,15 +2001,6 @@ func NewStruct(pkg *Pkg, fields []*Field) *Type {
        return t
 }
 
-func anyBroke(fields []*Field) bool {
-       for _, f := range fields {
-               if f.Broke() {
-                       return true
-               }
-       }
-       return false
-}
-
 var (
        IsInt     [NTYPE]bool
        IsFloat   [NTYPE]bool