Source file src/internal/types/errors/code_string.go

     1  // Code generated by "stringer -type Code codes.go"; DO NOT EDIT.
     2  
     3  package errors
     4  
     5  import "strconv"
     6  
     7  func _() {
     8  	// An "invalid array index" compiler error signifies that the constant values have changed.
     9  	// Re-run the stringer command to generate them again.
    10  	var x [1]struct{}
    11  	_ = x[InvalidSyntaxTree - -1]
    12  	_ = x[Test-1]
    13  	_ = x[BlankPkgName-2]
    14  	_ = x[MismatchedPkgName-3]
    15  	_ = x[InvalidPkgUse-4]
    16  	_ = x[BadImportPath-5]
    17  	_ = x[BrokenImport-6]
    18  	_ = x[ImportCRenamed-7]
    19  	_ = x[UnusedImport-8]
    20  	_ = x[InvalidInitCycle-9]
    21  	_ = x[DuplicateDecl-10]
    22  	_ = x[InvalidDeclCycle-11]
    23  	_ = x[InvalidTypeCycle-12]
    24  	_ = x[InvalidConstInit-13]
    25  	_ = x[InvalidConstVal-14]
    26  	_ = x[InvalidConstType-15]
    27  	_ = x[UntypedNilUse-16]
    28  	_ = x[WrongAssignCount-17]
    29  	_ = x[UnassignableOperand-18]
    30  	_ = x[NoNewVar-19]
    31  	_ = x[MultiValAssignOp-20]
    32  	_ = x[InvalidIfaceAssign-21]
    33  	_ = x[InvalidChanAssign-22]
    34  	_ = x[IncompatibleAssign-23]
    35  	_ = x[UnaddressableFieldAssign-24]
    36  	_ = x[NotAType-25]
    37  	_ = x[InvalidArrayLen-26]
    38  	_ = x[BlankIfaceMethod-27]
    39  	_ = x[IncomparableMapKey-28]
    40  	_ = x[InvalidPtrEmbed-30]
    41  	_ = x[BadRecv-31]
    42  	_ = x[InvalidRecv-32]
    43  	_ = x[DuplicateFieldAndMethod-33]
    44  	_ = x[DuplicateMethod-34]
    45  	_ = x[InvalidBlank-35]
    46  	_ = x[InvalidIota-36]
    47  	_ = x[MissingInitBody-37]
    48  	_ = x[InvalidInitSig-38]
    49  	_ = x[InvalidInitDecl-39]
    50  	_ = x[InvalidMainDecl-40]
    51  	_ = x[TooManyValues-41]
    52  	_ = x[NotAnExpr-42]
    53  	_ = x[TruncatedFloat-43]
    54  	_ = x[NumericOverflow-44]
    55  	_ = x[UndefinedOp-45]
    56  	_ = x[MismatchedTypes-46]
    57  	_ = x[DivByZero-47]
    58  	_ = x[NonNumericIncDec-48]
    59  	_ = x[UnaddressableOperand-49]
    60  	_ = x[InvalidIndirection-50]
    61  	_ = x[NonIndexableOperand-51]
    62  	_ = x[InvalidIndex-52]
    63  	_ = x[SwappedSliceIndices-53]
    64  	_ = x[NonSliceableOperand-54]
    65  	_ = x[InvalidSliceExpr-55]
    66  	_ = x[InvalidShiftCount-56]
    67  	_ = x[InvalidShiftOperand-57]
    68  	_ = x[InvalidReceive-58]
    69  	_ = x[InvalidSend-59]
    70  	_ = x[DuplicateLitKey-60]
    71  	_ = x[MissingLitKey-61]
    72  	_ = x[InvalidLitIndex-62]
    73  	_ = x[OversizeArrayLit-63]
    74  	_ = x[MixedStructLit-64]
    75  	_ = x[InvalidStructLit-65]
    76  	_ = x[MissingLitField-66]
    77  	_ = x[DuplicateLitField-67]
    78  	_ = x[UnexportedLitField-68]
    79  	_ = x[InvalidLitField-69]
    80  	_ = x[UntypedLit-70]
    81  	_ = x[InvalidLit-71]
    82  	_ = x[AmbiguousSelector-72]
    83  	_ = x[UndeclaredImportedName-73]
    84  	_ = x[UnexportedName-74]
    85  	_ = x[UndeclaredName-75]
    86  	_ = x[MissingFieldOrMethod-76]
    87  	_ = x[BadDotDotDotSyntax-77]
    88  	_ = x[NonVariadicDotDotDot-78]
    89  	_ = x[MisplacedDotDotDot-79]
    90  	_ = x[InvalidDotDotDot-81]
    91  	_ = x[UncalledBuiltin-82]
    92  	_ = x[InvalidAppend-83]
    93  	_ = x[InvalidCap-84]
    94  	_ = x[InvalidClose-85]
    95  	_ = x[InvalidCopy-86]
    96  	_ = x[InvalidComplex-87]
    97  	_ = x[InvalidDelete-88]
    98  	_ = x[InvalidImag-89]
    99  	_ = x[InvalidLen-90]
   100  	_ = x[SwappedMakeArgs-91]
   101  	_ = x[InvalidMake-92]
   102  	_ = x[InvalidReal-93]
   103  	_ = x[InvalidAssert-94]
   104  	_ = x[ImpossibleAssert-95]
   105  	_ = x[InvalidConversion-96]
   106  	_ = x[InvalidUntypedConversion-97]
   107  	_ = x[BadOffsetofSyntax-98]
   108  	_ = x[InvalidOffsetof-99]
   109  	_ = x[UnusedExpr-100]
   110  	_ = x[UnusedVar-101]
   111  	_ = x[MissingReturn-102]
   112  	_ = x[WrongResultCount-103]
   113  	_ = x[OutOfScopeResult-104]
   114  	_ = x[InvalidCond-105]
   115  	_ = x[InvalidPostDecl-106]
   116  	_ = x[InvalidIterVar-108]
   117  	_ = x[InvalidRangeExpr-109]
   118  	_ = x[MisplacedBreak-110]
   119  	_ = x[MisplacedContinue-111]
   120  	_ = x[MisplacedFallthrough-112]
   121  	_ = x[DuplicateCase-113]
   122  	_ = x[DuplicateDefault-114]
   123  	_ = x[BadTypeKeyword-115]
   124  	_ = x[InvalidTypeSwitch-116]
   125  	_ = x[InvalidExprSwitch-117]
   126  	_ = x[InvalidSelectCase-118]
   127  	_ = x[UndeclaredLabel-119]
   128  	_ = x[DuplicateLabel-120]
   129  	_ = x[MisplacedLabel-121]
   130  	_ = x[UnusedLabel-122]
   131  	_ = x[JumpOverDecl-123]
   132  	_ = x[JumpIntoBlock-124]
   133  	_ = x[InvalidMethodExpr-125]
   134  	_ = x[WrongArgCount-126]
   135  	_ = x[InvalidCall-127]
   136  	_ = x[UnusedResults-128]
   137  	_ = x[InvalidDefer-129]
   138  	_ = x[InvalidGo-130]
   139  	_ = x[BadDecl-131]
   140  	_ = x[RepeatedDecl-132]
   141  	_ = x[InvalidUnsafeAdd-133]
   142  	_ = x[InvalidUnsafeSlice-134]
   143  	_ = x[UnsupportedFeature-135]
   144  	_ = x[NotAGenericType-136]
   145  	_ = x[WrongTypeArgCount-137]
   146  	_ = x[CannotInferTypeArgs-138]
   147  	_ = x[InvalidTypeArg-139]
   148  	_ = x[InvalidInstanceCycle-140]
   149  	_ = x[InvalidUnion-141]
   150  	_ = x[MisplacedConstraintIface-142]
   151  	_ = x[InvalidMethodTypeParams-143]
   152  	_ = x[MisplacedTypeParam-144]
   153  	_ = x[InvalidUnsafeSliceData-145]
   154  	_ = x[InvalidUnsafeString-146]
   155  	_ = x[InvalidClear-148]
   156  	_ = x[TypeTooLarge-149]
   157  	_ = x[InvalidMinMaxOperand-150]
   158  	_ = x[TooNew-151]
   159  }
   160  
   161  const (
   162  	_Code_name_0 = "InvalidSyntaxTree"
   163  	_Code_name_1 = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilUseWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKey"
   164  	_Code_name_2 = "InvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDot"
   165  	_Code_name_3 = "InvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDecl"
   166  	_Code_name_4 = "InvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidExprSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGoBadDeclRepeatedDeclInvalidUnsafeAddInvalidUnsafeSliceUnsupportedFeatureNotAGenericTypeWrongTypeArgCountCannotInferTypeArgsInvalidTypeArgInvalidInstanceCycleInvalidUnionMisplacedConstraintIfaceInvalidMethodTypeParamsMisplacedTypeParamInvalidUnsafeSliceDataInvalidUnsafeString"
   167  	_Code_name_5 = "InvalidClearTypeTooLargeInvalidMinMaxOperandTooNew"
   168  )
   169  
   170  var (
   171  	_Code_index_1 = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 218, 234, 253, 261, 277, 295, 312, 330, 354, 362, 377, 393, 411}
   172  	_Code_index_2 = [...]uint16{0, 15, 22, 33, 56, 71, 83, 94, 109, 123, 138, 153, 166, 175, 189, 204, 215, 230, 239, 255, 275, 293, 312, 324, 343, 362, 378, 395, 414, 428, 439, 454, 467, 482, 498, 512, 528, 543, 560, 578, 593, 603, 613, 630, 652, 666, 680, 700, 718, 738, 756}
   173  	_Code_index_3 = [...]uint16{0, 16, 31, 44, 54, 66, 77, 91, 104, 115, 125, 140, 151, 162, 175, 191, 208, 232, 249, 264, 274, 283, 296, 312, 328, 339, 354}
   174  	_Code_index_4 = [...]uint16{0, 14, 30, 44, 61, 81, 94, 110, 124, 141, 158, 175, 190, 204, 218, 229, 241, 254, 271, 284, 295, 308, 320, 329, 336, 348, 364, 382, 400, 415, 432, 451, 465, 485, 497, 521, 544, 562, 584, 603}
   175  	_Code_index_5 = [...]uint8{0, 12, 24, 44, 50}
   176  )
   177  
   178  func (i Code) String() string {
   179  	switch {
   180  	case i == -1:
   181  		return _Code_name_0
   182  	case 1 <= i && i <= 28:
   183  		i -= 1
   184  		return _Code_name_1[_Code_index_1[i]:_Code_index_1[i+1]]
   185  	case 30 <= i && i <= 79:
   186  		i -= 30
   187  		return _Code_name_2[_Code_index_2[i]:_Code_index_2[i+1]]
   188  	case 81 <= i && i <= 106:
   189  		i -= 81
   190  		return _Code_name_3[_Code_index_3[i]:_Code_index_3[i+1]]
   191  	case 108 <= i && i <= 146:
   192  		i -= 108
   193  		return _Code_name_4[_Code_index_4[i]:_Code_index_4[i+1]]
   194  	case 148 <= i && i <= 151:
   195  		i -= 148
   196  		return _Code_name_5[_Code_index_5[i]:_Code_index_5[i+1]]
   197  	default:
   198  		return "Code(" + strconv.FormatInt(int64(i), 10) + ")"
   199  	}
   200  }
   201  

View as plain text