Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (42 sloc) 1.27 KB
=begin pod =TITLE class X::Redeclaration =SUBTITLE Compilation error due to declaring an already declared symbol class X::Redeclaration does X::Comp { } Thrown when a symbol (variable, routine, type, parameter, ...) is redeclared. Note that redeclarations are generally fine in an inner scope, but if the redeclaration appears in the same scope as the original declaration, it usually indicates an error and is treated as one. Examples =for code my $x; my $x; dies with =for code :lang ===SORRY!=== Redeclaration of symbol $x It works with routines too: =for code :skip-test sub f() { } sub f() { } dies with =for code :lang ===SORRY!=== Redeclaration of routine f But those are fine =for code my $x; sub f() { my $x; # not a redeclaration, # because it's in an inner scope sub f() { }; # same } =head1 Methods =head2 method symbol Returns the name of the symbol that was redeclared. =head2 method what Returns the kind of symbol that was redeclared. Usually C, but can also be C, C etc. =head2 method postfix Returns a string that is attached to the end of the error message. It usually explains the particular problem in more detail, or suggests way to fix the problem. =end pod
You can’t perform that action at this time.