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

using syntax "@a of Int" (multiple times) leads to weird type check errors #4325

Closed
p6rt opened this issue Jun 15, 2015 · 7 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jun 15, 2015

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

Searchable as RT125412$

@p6rt
Copy link
Author

p6rt commented Jun 15, 2015

From andrspv@gmail.com

% perl6 -v
This is perl6 version 2015.05-197-g28a7697 built on MoarVM version
2015.05-79-g458940f

sub x() returns Array of Int { my @​x of Int = 1,2,3 };
sub x ( --> Array[Int]) { #`(Sub|42347328) ... }
x().WHAT.say
Type check failed for return value; expected 'Array[Int]' but got 'Array[Int]'
  in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
  in sub x at <unknown file>​:1
  in block <unit> at <unknown file>​:1

Redeclaration of routine in REPL causes the following

sub x() returns Array of Int { return my @​x of Int = 1,2,3 }; x().WHAT.say
Type check failed for return value; expected 'Array[Int]' but got 'Array[Int]'
  in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
  in sub x at <unknown file>​:1
  in block <unit> at <unknown file>​:1

sub x() returns Array of Int { return my @​x of Int = 1,2,3 }; x().WHAT.say
Type check failed for return value; expected 'Array[Int][Int]' but got
'Array[Int][Int]'
  in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
  in sub x at <unknown file>​:1
  in block <unit> at <unknown file>​:1

sub x() returns Array of Int { return my @​x of Int = 1,2,3 }; x().WHAT.say
Type check failed for return value; expected 'Array[Int][Int][Int]'
but got 'Array[Int][Int][Int]'
  in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
  in sub x at <unknown file>​:1
  in block <unit> at <unknown file>​:1

sub x() returns Array of Int { return my @​x of Int = 1,2,3 }; x().WHAT.say
Type check failed for return value; expected
'Array[Int][Int][Int][Int]' but got 'Array[Int][Int][Int][Int]'
  in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
  in sub x at <unknown file>​:1
  in block <unit> at <unknown file>​:1

sub x() returns Array of Int { return my @​x of Int = 1,2,3 }; x().WHAT.say
Type check failed for return value; expected
'Array[Int][Int][Int][Int][Int]' but got
'Array[Int][Int][Int][Int][Int]'
  in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
  in sub x at <unknown file>​:1
  in block <unit> at <unknown file>​:1

@p6rt
Copy link
Author

p6rt commented Oct 25, 2015

From @usev6

There is another recent bug report about the problem shown here​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126136

IMHO, that other report describes the symptoms very clear and provides a good base for working on a fix.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 25, 2015

From @usev6

There is another recent bug report about the problem shown here​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126136

IMHO, that other report describes the symptoms very clear and provides a good base for working on a fix.

@p6rt
Copy link
Author

p6rt commented Oct 25, 2015

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

@p6rt
Copy link
Author

p6rt commented Aug 23, 2016

From @coke

On Mon Jun 15 01​:43​:52 2015, andrspv@​gmail.com wrote​:

% perl6 -v
This is perl6 version 2015.05-197-g28a7697 built on MoarVM version
2015.05-79-g458940f

sub x() returns Array of Int { my @​x of Int = 1,2,3 };
sub x ( --> Array[Int]) { #`(Sub|42347328) ... }
x().WHAT.say
Type check failed for return value; expected 'Array[Int]' but got
'Array[Int]'
in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
in sub x at <unknown file>​:1
in block <unit> at <unknown file>​:1

Redeclaration of routine in REPL causes the following

sub x() returns Array of Int { return my @​x of Int = 1,2,3 };
x().WHAT.say
Type check failed for return value; expected 'Array[Int]' but got
'Array[Int]'
in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
in sub x at <unknown file>​:1
in block <unit> at <unknown file>​:1

sub x() returns Array of Int { return my @​x of Int = 1,2,3 };
x().WHAT.say
Type check failed for return value; expected 'Array[Int][Int]' but got
'Array[Int][Int]'
in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
in sub x at <unknown file>​:1
in block <unit> at <unknown file>​:1

sub x() returns Array of Int { return my @​x of Int = 1,2,3 };
x().WHAT.say
Type check failed for return value; expected 'Array[Int][Int][Int]'
but got 'Array[Int][Int][Int]'
in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
in sub x at <unknown file>​:1
in block <unit> at <unknown file>​:1

sub x() returns Array of Int { return my @​x of Int = 1,2,3 };
x().WHAT.say
Type check failed for return value; expected
'Array[Int][Int][Int][Int]' but got 'Array[Int][Int][Int][Int]'
in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
in sub x at <unknown file>​:1
in block <unit> at <unknown file>​:1

sub x() returns Array of Int { return my @​x of Int = 1,2,3 };
x().WHAT.say
Type check failed for return value; expected
'Array[Int][Int][Int][Int][Int]' but got
'Array[Int][Int][Int][Int][Int]'
in any return_error at src/vm/moar/Perl6/Ops.nqp​:639
in sub x at <unknown file>​:1
in block <unit> at <unknown file>​:1

This is fine with 2016.07.1 - Closable with tests.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 10, 2016

From @zoffixznet

Tests added in Raku/roast@457d3d8b92

@p6rt p6rt closed this as completed Sep 10, 2016
@p6rt
Copy link
Author

p6rt commented Sep 10, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant