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

Binding to access of typed array doesn't type check #3674

Closed
p6rt opened this issue Feb 9, 2015 · 6 comments
Closed

Binding to access of typed array doesn't type check #3674

p6rt opened this issue Feb 9, 2015 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 9, 2015

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

Searchable as RT123769$

@p6rt
Copy link
Author

p6rt commented Feb 9, 2015

From @Mouq

The following should die​:

$ perl6 -e'my Int @​a; @​a[0] := "foo"'
$

Presumably the error would be similar to the correct error given by
assignment

$ perl6 -e'my Int @​a; @​a[0] = "foo"'
Type check failed in assignment to '@​a'; expected 'Int' but got 'Str'
  in method assign_pos at src/gen/m-CORE.setting​:10294
  in sub postcircumfix​:<[ ]> at src/gen/m-CORE.setting​:3285
  in block <unit> at -e​:1

@p6rt
Copy link
Author

p6rt commented Jun 30, 2015

From @usev6

I just linked this ticket from https://rt-archive.perl.org/perl6/Ticket/Display.html?id=81682, which is now closed but pointed to a similiar problem​:

$ perl6-m -e 'my Int @​a = 1, 2, 3; my Str $x = "foo"; @​a[0] := $x; say @​a[0];'
foo

It would be nice, if both variants (binding to a string directly and binding to a scalar variable of type Str) would be tested, once the type check is implemented

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 30, 2015

From @usev6

I just linked this ticket from https://rt-archive.perl.org/perl6/Ticket/Display.html?id=81682, which is now closed but pointed to a similiar problem​:

$ perl6-m -e 'my Int @​a = 1, 2, 3; my Str $x = "foo"; @​a[0] := $x; say @​a[0];'
foo

It would be nice, if both variants (binding to a string directly and binding to a scalar variable of type Str) would be tested, once the type check is implemented

@p6rt
Copy link
Author

p6rt commented Jun 30, 2015

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

@p6rt
Copy link
Author

p6rt commented Oct 6, 2015

From @jnthn

On Tue Jun 30 04​:13​:41 2015, bartolin@​gmx.de wrote​:

I just linked this ticket from
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=81682, which is now closed
but pointed to a similiar problem​:

$ perl6-m -e 'my Int @​a = 1, 2, 3; my Str $x = "foo"; @​a[0] := $x; say
@​a[0];'
foo

It would be nice, if both variants (binding to a string directly and
binding to a scalar variable of type Str) would be tested, once the
type check is implemented

Fixed, and added both test cases to S09-typed-arrays/arrays.t.

@p6rt
Copy link
Author

p6rt commented Oct 6, 2015

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

@p6rt p6rt closed this as completed Oct 6, 2015
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant