[perl #125902] [LTA] error message “Type 'Str' is not declared” (my Str where 'foo' $test;)
I merged the PR. Thank you for you patience. 「testneeded」 See https://github.com/rakudo/rakudo/commit/c7a82d451d6506bda9422813fe72974575e473df You can see some code examples here: https://github.com/rakudo/rakudo/pull/565#issuecomment-334965048 Maybe these can be turned into tests easily. On 2016-05-08 08:59:55, barto...@gmx.de wrote: > As a status update: All code snippet in this ticket die now with > X::Syntax::Malformed and complain about 'Malformed my' during > compilation (I think, it was fixed with rakudo commit e1e03e6ed5): > > $ perl6-m -e 'my Str where "foo" $test' > ===SORRY!=== Error while compiling -e > Malformed my > at -e:1 > --> my Str⏏ where "foo" $test > > $ perl6-m -e 'my str where "foo" $test' > ===SORRY!=== Error while compiling -e > Malformed my > at -e:1 > --> my str⏏ where "foo" $test > > $ perl6-m -e 'my Int' > ===SORRY!=== Error while compiling -e > Malformed my > at -e:1 > --> my Int⏏ > > A while ago I opened a PR (https://github.com/rakudo/rakudo/pull/565) > related to this ticket. I added some code in order to detect misplaced > where clauses, etc. But that PR was not merged (probably my patch was > a bit over-engineered). It looks like my branch is not mergeable > anymore -- maybe I should close it.
[perl #125902] [LTA] error message “Type 'Str' is not declared” (my Str where 'foo' $test;)
As a status update: All code snippet in this ticket die now with X::Syntax::Malformed and complain about 'Malformed my' during compilation (I think, it was fixed with rakudo commit e1e03e6ed5): $ perl6-m -e 'my Str where "foo" $test' ===SORRY!=== Error while compiling -e Malformed my at -e:1 --> my Str⏏ where "foo" $test $ perl6-m -e 'my str where "foo" $test' ===SORRY!=== Error while compiling -e Malformed my at -e:1 --> my str⏏ where "foo" $test $ perl6-m -e 'my Int' ===SORRY!=== Error while compiling -e Malformed my at -e:1 --> my Int⏏ A while ago I opened a PR (https://github.com/rakudo/rakudo/pull/565) related to this ticket. I added some code in order to detect misplaced where clauses, etc. But that PR was not merged (probably my patch was a bit over-engineered). It looks like my branch is not mergeable anymore -- maybe I should close it.
[perl #125902] LTA error message “Type 'Str' is not declared” (my Str where 'foo' $test;)
# New Ticket Created by Alex Jakimenko # Please include the string: [perl #125902] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=125902 > Code: my Str where 'foo' $test; Result: ===SORRY!=== Type 'Str' is not declared. Did you mean 'str'? at ./test.pl:2 --> my Str ⏏where 'foo' $test; Malformed my at ./test.pl:2 --> my Str ⏏where 'foo' $test; Well, let's also try what it says: my str where 'foo' $test; Result: ===SORRY!=== Type 'str' is not declared. Did you mean 'Str'? at ./test.pl:2 --> my str ⏏where 'foo' $test; Malformed my at ./test.pl:2 --> my str ⏏where 'foo' $test; Current error message is misleading. But when it's fixed, maybe it could figure out that 'where' is misplaced? For me it was a natural thing to type “Str where 'foo'”, I think that other people could mistakenly try that too. If it is possible to detect that and suggest a fix, so much the better.