Created
July 6, 2011 18:23
-
-
Save tadzik/1067948 to your computer and use it in GitHub Desktop.
Double bacon strikes again
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
745 elsif $primitive eq 'type_new' { | |
746 $constant := $type_obj.new(|@value, |%named); | |
747 say("constant: ", $constant); | |
748 $des := PAST::Op.new( | |
749 :pasttype('callmethod'), :name('new'), | |
750 $type_obj_lookup | |
751 ); | |
752 say("constant1.2: ", $constant); | |
Called with: | |
247 my $cheatpast := $*ST.add_constant('Str', 'str', 'bacon'); | |
248 say("creating an array"); | |
249 my $content := $*ST.add_constant( | |
250 'Array', 'type_new', $cheatpast<compile_time_value> | |
251 ); | |
252 say("produced: ", $content<compile_time_value>); | |
Output: | |
creating an array | |
cache_key: Array,type_new,bacon | |
constant: bacon | |
constant1.2: bacon bacon | |
Somehow, line 748 of the first snippet duplicates the array element. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment