]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/go/types/errorcodes.go
[dev.typeparams] merge dev.regabi (618e3c1) into dev.typeparams
[gostls13.git] / src / go / types / errorcodes.go
index d27abdf4d48bf144e48a2fe45e771df81669b212..2837019bf5ec39dd56b77a23c634e7aadec4353f 100644 (file)
@@ -756,52 +756,12 @@ const (
        _NonVariadicDotDotDot
 
        // _MisplacedDotDotDot occurs when a "..." is used somewhere other than the
-       // final argument to a function call.
+       // final argument in a function declaration.
        //
        // Example:
-       //  func printArgs(args ...int) {
-       //      for _, a := range args {
-       //              println(a)
-       //      }
-       //  }
-       //
-       //  func f() {
-       //      a := []int{1,2,3}
-       //      printArgs(0, a...)
-       //  }
+       //      func f(...int, int)
        _MisplacedDotDotDot
 
-       // _InvalidDotDotDotOperand occurs when a "..." operator is applied to a
-       // single-valued operand.
-       //
-       // Example:
-       //  func printArgs(args ...int) {
-       //      for _, a := range args {
-       //              println(a)
-       //      }
-       //  }
-       //
-       //  func f() {
-       //      a := 1
-       //      printArgs(a...)
-       //  }
-       //
-       // Example:
-       //  func args() (int, int) {
-       //      return 1, 2
-       //  }
-       //
-       //  func printArgs(args ...int) {
-       //      for _, a := range args {
-       //              println(a)
-       //      }
-       //  }
-       //
-       //  func g() {
-       //      printArgs(args()...)
-       //  }
-       _InvalidDotDotDotOperand
-
        // _InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in
        // function.
        //
@@ -1081,18 +1041,6 @@ const (
        //  }
        _InvalidPostDecl
 
-       // _InvalidChanRange occurs when a send-only channel used in a range
-       // expression.
-       //
-       // Example:
-       //  func sum(c chan<- int) {
-       //      s := 0
-       //      for i := range c {
-       //              s += i
-       //      }
-       //  }
-       _InvalidChanRange
-
        // _InvalidIterVar occurs when two iteration variables are used while ranging
        // over a channel.
        //
@@ -1366,4 +1314,8 @@ const (
        //      return i
        //  }
        _InvalidGo
+
+       // _Todo is a placeholder for error codes that have not been decided.
+       // TODO(rFindley) remove this error code after deciding on errors for generics code.
+       _Todo
 )