Skip to content

Instantly share code, notes, and snippets.

@moritz
Created March 20, 2011 17:49
Show Gist options
  • Save moritz/878489 to your computer and use it in GitHub Desktop.
Save moritz/878489 to your computer and use it in GitHub Desktop.
Perl 6 error messages (don't believe the classification yet)
Syntax
obsolete
* <STDIN> $*IN.lines
* <> lines() to read input,\n or ('') to represent the null string,\n or () to represent Nil
* do...$s repeat...$s
C-style "for (;;)" loop "loop (;;)"
foreach for
Perl 5's $all construct a smartmatch like \$! ~~ $inside
...
Whitespace required after keyword
Name component may not be null
%s character is ont allowed as delimiter (Whitespace, Alphanumeric)
"Use of a closing delimiter for an opener is reserved"
"Colons may not be used to delimit quoting constructs"
"Ending delimiter $*DELIM not found"
"Couldn't find terminator $stop"
"Opening bracket is required for #` comment"
Pod
"=begin $id without matching =end $id"
"=begin without matching =end"
"Unrecognized token after =for"
"Obsolescent pod format, please use =begin/=end instead"
"Unable to parse statement list; couldn't find right brace"
"Confused"
Missing block
Malformed %s
(multi, proto, only $*PKGDECL, $*SCOPE, block, block gobbled by %s,
routine, method, regex, macr, parameter, subset, constant)
Unrecognized adverbs %s
"Unable to parse regex; couldn't find right brace"
"Bogus statement"
"Strange text after block (missing comma, semicolon, comment marker?)"
"Missing semicolon"
"\"unless\" does not take \"else\" in Perl 6; please rewrite using \"if\""
"This appears to be Perl 5 code"
"Whitespace required after keyword"
"Compilation unit cannot be anonymous"
"Semicolon form of " ~ $*PKGDECL ~ " definition not allowed in subscope;\n please use block form"
NYI
"Semicolon form of package definition indicates a Perl 5 module; unfortunately,\n STD doesn't know how to parse Perl 5 code yet"
"Too late for semicolon form of " ~ $*PKGDECL ~ " definition"
"Unable to parse " ~ $*PKGDECL ~ " definition"
"Prefix requires an argument"
Literals
"Malformed radix number"
"Malformed False pair; expected identifier"
"Extra argument not allowed; pair already has False argument"
"Argument not allowed on negated pair"
"Can't negate $opt adverb"
"Unrecognized character name"
"Unrecognized \\c character"
"Unrecognized adverb :" ~ $kv.<k> ~ '(' ~ $kv.<v> ~ ')'
"2nd argument not allowed on pair"
"Decimal point must be followed by digit"
"Only isolated underscores are allowed inside numbers"
"Number contains two decimal points (missing 'v' for version number?)"
"Base is missing ** exponent part"
"Can't declare an indirect variable name"
"Please use 'elsif'"
"Whitespace required before block"
'Found a version control conflict marker'>
"Whitespace is required between alphanumeric tokens"
"Invalid hard reference syntax"
"Can't declare a numeric variable"
"Can't declare a match variable"
"Can't declare a contextualizer"
"Missing initializer on constant declaration"
"Non-declarative sigil is missing its name"
"Missing assignment operator"
"Malformed replacement part; couldn't find final $stop"
"Unable to parse regex; couldn't find final '/'"
"You can't backslash that"
"\\| signature must contain one variable"
"\\| signature may contain only a variable"
"Typename " ~ $<longname>[0].Str ~ " must be predeclared"
"No type found after -->"
Parameter
"Unable to parse named parameter; couldn't find right parenthesis"
"Can't declare a numeric parameter"
"You may not use the $twigil twigil in a signature"
"Multiple prefix constraints not yet supported"
"In parameter declaration, typename '" ~ $<longname>.Str ~ "' must be predeclared (or marked as declarative with :: prefix)"
"Can't put a default on a required parameter"
"Can't put a default on a slurpy parameter"
"Can't put a default on a slice parameter"
"Can't put a default on an slurpy capture parameter"
"Can't put a default on a capture parameter"
"Can't put a default on the invocant parameter"
"Default expression must come last"
"Invocant is too exotic"
"Can't put required parameter after optional parameters"
"Can't put required parameter after variadic parameters"
"Can't put optional positional parameter after variadic parameters"
"Cannot put ':' parameter separator after first parameter"
Placeholder
"Placeholder variable $name is not allowed in the$decl signature"
"Placeholder variable $name may not be used outside of a block"
"Placeholder variable $name may not be used here because the surrounding$decl block takes no signature"
"Placeholder variable $name may not be package qualified"
"$varname has already been used as a non-placeholder in the surrounding$decl block,\n so you will confuse the reader if you suddenly declare $name here"
'Can not have more than one sub-signature for a parameter'
"Word '$_' interpreted as '$_" ~ "()' function call; please use whitespace " ~ ($needparens ?? 'around the parens' !! 'instead of parens') ~ $m<token>.locmess ~ "\nUnexpected block in infix position (two terms in a row)
"Unexpected block in infix position (previous line missing its semicolon?)"
"Unexpected block in infix position (method call needs colon or parens to take arguments)"
"Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?)"
"Method call found where infix expected (omit whitespace?)"
"Postfix found where infix expected (omit whitespace?)"
"Negation metaoperator not followed by valid infix"
"Can't negate " ~ $<infixish>.Str ~ " because " ~ $<infixish><O><dba> ~ " operators are not iffy enough"
"Missing « or »"
"Missing << or >>"
"Whitespace required before < operator"
"Unable to parse quote-words subscript; couldn't find right angle quote"
"Unable to parse quote-words subscript; couldn't find right double-angle quote"
"Please use ..* for indefinite range"
Ternary
"Please use !! rather than %s"
"Precedence of $b is too loose to use between ?? and !!; please use parens around inner expression"
"An infix may not start with !!"
"Ternary !! seems to be missing its ??"
"Non-variable \$ must be backslashed"
"Too late for %s" (:q, :qq, :cc)
"Bogus Term"
"Please backslash # for literal char or put whitespace in front for comment"
'Unknown associativity "' ~ $_ ~ '" for "' ~ $infix<sym> ~ '"''
"Internal operator parser error, termstack == " ~ (+@termstack)
Regex
"No unspace allowed in regex; if you meant to match the literal character, please enclose in single quotes ('" ~ substr($::ORIG,$¢.pos,1) ~ "') or use a backslashed form like \\x" ~ sprintf('%02x', ord(substr($::ORIG,$¢.pos,1))
"Regex not terminated"
"Unrecognized regex metacharacter " ~ $0.Str ~ " (must be quoted to match literally)"
"Null pattern not allowed"
"Unmatched closing $c"
"Can't quantify zero-width atom"
"Semicolon must be quoted"
"Regex missing terminator (or semicolon must be quoted?)
"Regex missing terminator"
"Quantifier quantifies nothing"
"Backtrack control ':' does not seem to have a preceding atom to control"
"$n requires an argument"
"Assertion call missing right parenthesis"
"Unrecognized regex assertion"
"Spaces not allowed in bare range"
"Empty range"
"Range missing start character on the left"
"Range missing stop character on the right"
"Unrecognized quote modifier: " ~ join('',@k)
"Unrecognized quasiquote modifier: " ~ join('',@k)
"\\a is allowed only in strings, not regexes"
"Unrecognized regex modifier " ~ $0.Str
$all ~ " as general quantifier", 'X**' ~ $repl
"Expecting a term, but found either infix $bad or redundant prefix $c\n (to suppress this message, please use space between $c $c)"
"Preceding context expects a term, but found infix $bad instead"
Reserved
"The () shape syntax in routine declarations is reserved (maybe use :() to declare a longname?)
"The () shape syntax in array declarations is reserved"
"The () shape syntax in hash declarations is reserved"
"The () shape syntax in variable declarations is reserved"
"Extra 'of' type; already declared as type " ~ $*DECLARAND<of>.Str
Metaops
"Can't " ~ $meta ~ " " ~ $op<sym> ~ " because " ~ $op<O><dba> ~ " operators are too fiddly"
"Can't reduce with " ~ $op<sym> ~ " because " ~ $op<O><dba> ~ " operators are diffy and not chaining"
"Can't make assignment out of " ~ $op<sym> ~ " because " ~ $op<O><dba> ~ " operators are diffy"
"Illegal use of colon as invocant marker"
"Can't $scope $pkgdecl $name without MONKEY_TYPING"
Declaration
"Lexical symbol '$name' is already bound to an outer symbol$loc;\n the implicit outer binding at line $rebind must be rewritten as $truename\n before you can unambiguously declare a new '$name' in this scope"
"Illegal redeclaration of symbol '$name'$loc"
"Illegal redeclaration of routine '$name'$loc"
"Illegal redeclaration of symbol '$sid'$loc"
"Variable $name is not predeclared (declarators are tighter than comma, so maybe your '$scope' signature needs parens?)"
"Variable $name is not predeclared (did you mean \%$id?)"
"Variable $name is not predeclared"
Compile time
"Perl $<version> required--this is only v$mpv"
"No HOW declared for package declarator $*PKGDECL"
"Can not nest a package inside a role"
'Unknown declarator type'
"Can not declare an attribute outside of a package"
"Can not declare method outside of a package"
"Can not re-declare attribute " ~ $attrname
'Can not apply more than one of: is copy, is rw, is readonly'
"'is copy' trait not valid on variable declaration"
'Can not put ' ~ $*MULTINESS ~ ' on anonymous routine'
'Placeholder variables cannot be used in a method'
'proto ' ~ ~$<sym> ~ 's cannot be anonymous
'Cannot declare proto ' ~ ~$<sym> ~ ' ' ~ $name ~ when another with this name was already declared
"Can not declare named " ~ ~$<sym> ~ " outside of a package"
"Can not declare a subset with scope declarator " ~ $*SCOPE
'A ' ~ $*SCOPE ~ ' scoped subset must have a name.'
"Can not use " ~ $<sym>.Str ~ " on a non-identifier method call"
'Value of adverb :' ~ $key ~ ' must be known at compile time
"Adverb '" ~ $_.ast.named ~ "' not allowed on " ~ $what
NYI
require with argument list
"Do not yet support $*SCOPE scoped enums"
'Constant type declarator not yet implemented'
'Can not do non-typename cases of type_constraint yet
'traits specified as colon pairs not yet understood'
'Sorry, do not know how to handle this case of a feed operator yet.'
"Sorry, multi-dimensional indexes are not yet supported"
"Can't form :w list from non-constant strings (yet)"
"RoleApply with attributes NYI"
"RoleApply with superclasses NYI"
Non-spec
"pir::op forbidden in safe mode\n"
"Q:PIR forbidden in safe mode\n"
v.Fetch().mo.name + " is not usable as a CLR object"
Runtime
"Writing to readonly scalar"
"Nominal type check failed for scalar store; got " + v.mo.name + ", needed " + type.name + " or subtype"
"Nominal type check failed for " + name + " needed " + mo.name + " got " + r.mo.name
"Cannot use hash access on an object of type " + os.mo.name
"Invalid index for non-array"
"private method lookup failed for " + name + " in class " + this.name
"Attempted to access slot " + name + " of type object for " + mo.name
"Recursive module graph detected at " + name + ": " + JoinS(" ", ModulesStarted
"Load module must have a type of the same name"
"Load module must have a BOOT method"
"Unknown source language " + lang
"Cannot eval; no compiler available"
"Cannot serialize subclasses of Hash that add attributes"
"{0} in JSYNC string at position {1}", s, ix
"JSON writer encountered value of type " + obj.mo.name
"No zero-arg meaning for infix:<%s>"
"When one argument of a hyperoperator is an unordered data structure, the other must be scalar"
"DateTime.truncated-to: exactly one named argument needed"
"DateTime.truncated-to: Unknown truncation unit '$unit'"
'Invalid Date string; please use the format "yyyy-mm-dd"'
"Date.truncated-to: exactly one named argument needed."
""Unable to open file '$filename'"
"Cannot copy '$.path': Is a directory"
"Cannot reverse an infinite list"
'Undefined value popped from empty array'
'Undefined value shifted from empty list'
".notdef is deprecated, please use negated .defined instead"
"Can only use does with a role, but " ~ $unrole.perl ~ " is not one"
"Can't call map() with a Hash argument, Callable required\n"
'No values matched'
"Option :replace is deprecated -- please use .roll"
'Cannot reduce() using a unary or nullary function.
'Can only reduce() using a binary function for now.'
'Cannot reduce() empty list'
"Cannot use negative index $pos on {self.WHO}"
".[$pos] out of range for type {self.WHAT}"
"postcircumfix:<\{ \}> not defined for type {self.WHAT}"
"Bridge must be defined for the Real type " ~ self.WHAT
'Odd number of elements found where hash expected'
"*..* is not a valid range"
"You can only coerce a Complex to Real if the imaginary part is zero"
"too many arguments passed - 0 params expected"
"Unknown encoding $encoding"
"Unrecognized directive $directive"
"Non-ASCII character $char"
"Can't take numeric value for object of type $.WHAT.perl()
"Use of uninitialized value in numeric context"
"Don't know how to handle a {.WHAT} as a substitution key"
"$p.perl() is not a Pair"
"Substring '$substring' not found in '{self}'"
":c / :continue requires a position in the string"
'Can not take ord of empty string'
"Nothing given for new socket to connect or bind to"
'Socket not available'
"Not connected"
"$.WHAT() needs a version of .%s"
"%s is only defined for Reals, you have a $.WHAT()
":action has been renamed to :actions in the Grammar.parse method"
"Need something on RHS"
"Don't know how to numify a Pair"
"$name must be in {$range.perl}\n
'No second 61 has yet been defined';
'A leap second can occur only at hour 23 and minute 59 UTC';
"There is no leap second on UTC $date"
'Invalid DateTime string; please an ISO 8601 timestamp'
"DateTime.new(Str): :timezone argument not allowed with a timestamp offset"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment