Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message “Type 'Str' is not declared” (my Str where 'foo' $test;) #4488

Closed
p6rt opened this issue Aug 25, 2015 · 8 comments
Closed
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded

Comments

@p6rt
Copy link

p6rt commented Aug 25, 2015

Migrated from rt.perl.org#125902 (status was 'resolved')

Searchable as RT125902$

@p6rt
Copy link
Author

p6rt commented Aug 25, 2015

From @AlexDaniel

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.

@p6rt
Copy link
Author

p6rt commented Nov 13, 2015

From @AlexDaniel

This can be golfed down to​:

my Int;

@p6rt
Copy link
Author

p6rt commented May 8, 2016

From @usev6

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�<EOL>

A while ago I opened a PR (rakudo/rakudo#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.

1 similar comment
@p6rt
Copy link
Author

p6rt commented May 8, 2016

From @usev6

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�<EOL>

A while ago I opened a PR (rakudo/rakudo#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.

@p6rt
Copy link
Author

p6rt commented May 8, 2016

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

From @AlexDaniel

I merged the PR. Thank you for you patience.

ï½¢testneededï½£

See rakudo/rakudo@c7a82d4

You can see some code examples here​: rakudo/rakudo#565 (comment)
Maybe these can be turned into tests easily.

On 2016-05-08 08​:59​:55, bartolin@​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�<EOL>

A while ago I opened a PR (rakudo/rakudo#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.

@p6rt
Copy link
Author

p6rt commented Oct 13, 2017

From @zoffixznet

Tests rakudo/rakudo@fb7abf064e

@p6rt p6rt closed this as completed Oct 13, 2017
@p6rt
Copy link
Author

p6rt commented Oct 13, 2017

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt added LTA Less Than Awesome; typically an error message that could be better testneeded labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded
Projects
None yet
Development

No branches or pull requests

1 participant