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

Coercion type in variable declarations #5853

Closed
p6rt opened this issue Dec 3, 2016 · 6 comments
Closed

Coercion type in variable declarations #5853

p6rt opened this issue Dec 3, 2016 · 6 comments
Labels
NYI Features not yet implemented

Comments

@p6rt
Copy link

p6rt commented Dec 3, 2016

Migrated from rt.perl.org#130253 (status was 'open')

Searchable as RT130253$

@p6rt
Copy link
Author

p6rt commented Dec 3, 2016

From @mscha

Coercion type works quite nicely in signatures, e.g.

  sub foo(Int(Cool) $f) {
  say $f.WHAT;
  }
  foo "42"; # (Int)

but it doesn't work yet in variable declarations, e.g.

  my Int(Cool) $x; $x = "42"; # Coercion Int(Cool) is insufficiently
type-like to qualify a variable

Using Rakudo Star 2016.11​:
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Dec 6, 2016

From @coke

On Sat, 03 Dec 2016 11​:31​:59 -0800, perl6@​mscha.org wrote​:

Coercion type works quite nicely in signatures, e.g.

 sub foo\(Int\(Cool\) $f\) \{
     say $f\.WHAT;
 \}
 foo "42";    \# \(Int\)

but it doesn't work yet in variable declarations, e.g.

 my Int\(Cool\) $x; $x = "42"; \# Coercion Int\(Cool\) is insufficiently 

type-like to qualify a variable

Using Rakudo Star 2016.11​:
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.

Can you point to where the specification test suite (roast), old design docs, IRC, or the docs site indicating where this was planned?

Thanks.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Dec 6, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Dec 7, 2016

From @mscha

On 6-Dec-16 17​:36, Will Coleda via RT wrote​:

On Sat, 03 Dec 2016 11​:31​:59 -0800, perl6@​mscha.org wrote​:

Coercion type works quite nicely in signatures, e.g.

  sub foo\(Int\(Cool\) $f\) \{
      say $f\.WHAT;
  \}
  foo "42";    \# \(Int\)

but it doesn't work yet in variable declarations, e.g.

  my Int\(Cool\) $x; $x = "42"; \# Coercion Int\(Cool\) is insufficiently

type-like to qualify a variable

Using Rakudo Star 2016.11​:
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.

Can you point to where the specification test suite (roast), old design docs, IRC, or the docs site indicating where this was planned?
https://irclog.perlgeek.de/perl6/2016-12-03#i_13674766
19​:23 TimToady it's just NYI
...
19​:23 AlexDaniel mscha​: therefore, submit a NYI ticket

Thanks,

  – Michael

@p6rt
Copy link
Author

p6rt commented Dec 7, 2016

From @mscha

(Apologies if this appears twice.)

I was told on IRC to report this as an NYI.
https://irclog.perlgeek.de/perl6/2016-12-03#i_13674766

Thanks,

  - Michael

@p6rt p6rt added the NYI Features not yet implemented label Jan 5, 2020
@usev6
Copy link

usev6 commented Apr 4, 2021

This has been implemented by @vrurg in the context of Raku/problem-solving#227. The example from above works now:

$ ./rakudo-m -e 'my Int(Cool) $x; $x = "42"; dd $x'
Int $x = 42

Tests have been added with Raku/roast#674, so I'm closing this issue.

@usev6 usev6 closed this as completed Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NYI Features not yet implemented
Projects
None yet
Development

No branches or pull requests

2 participants