# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #62162]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=62162 >
The following three correct Perl 6 modules give a runtime error in
Rakudo r35336.
$ cat CGI.pm
use v6;
use URI;
class CGI {
has URI $.uri;
}
$ cat URI.pm
use v6;
class URI;
use URI::Grammar;
$ cat URI/Grammar.pm
use v6;
grammar URI::Grammar {
}
$ perl6 -e 'use CGI; CGI.new'
Method 'item' not found for invocant of class 'FixedPMCArray'
[...]
The fact that the last file contains 'grammar' is irrelevant; 'class'
gives the same error. The relative order of 'class URI' and 'use
URI::Grammar' is also irrelevant.
These things make the problem go away:
* Removing the 'URI' typing of the $.uri attribute in CGI.pm.
* Making 'class URI' use braces instead of a semicolon in URI.pm.
* Removing the dependency on URI::Grammar in URI.pm.