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
Custom class :D coersers don't work #6410
Comments
From @zoffixznetThe coercion works fine here: 17:03 Zoffix m: class B {…}; class A { method B { B.new }}; class B {}; sub foo(B() $b) { say "hi" }; foo(A.new) But if I add `:D` smiley, it fails: 17:03 Zoffix m: class B {…}; class A { method B { B.new }}; class B {}; sub foo(B:D() $b) { say "hi" }; foo(A.new) |
From @skidsOn Mon, 24 Jul 2017 10:04:54 -0700, cpan@zoffix.com wrote:
Seems to be more generic than custom classes: $ perl6 -e 'sub foo(Int() $b) { say $b }; foo("42")' This raises the spec question, should e.g. IO:U($a) try to convert $a to an IO, This doesn't make much sense yet either: $ perl6 -e 'Int:D(4).say' |
The RT System itself - Status changed from 'new' to 'open' |
From @skidsOn Wed, 23 Aug 2017 06:20:49 -0700, bri@abrij.org wrote:
This ticket and RT#126433 can be combined. |
From @skidsOn Fri, 08 Sep 2017 21:13:59 -0700, bri@abrij.org wrote:
I spent some more time digging into this. There are a couple layers to this issue. The first is a syntax conflict. Consider (example from specs): use Dog:auth(/:i jrandom/):ver(v1.2.1 | v1.3.4); ...in order to parse that the generic "extended identifier" syntax is allowed to Now in the S02, "extended identifiers" are said to only allow a The second issue bears on the spec issue I raised above: if you do manage to To pile on that, we get to the (NYI) behavior where the adverbial components |
From @skidsOn Sun, 10 Sep 2017 11:44:09 -0700, bri@abrij.org wrote:
When fixing, please note also RT#130657 |
To update this old issue a bit: Original report: The evaluation given in the original report no longer errors out when a
(And since the link to irclog.perlgeek.de no longer works, here is equivalent link to colabti.org: https://colabti.org/irclogger/irclogger_log/perl6?date=2017-07-24#l754.) Non-custom class: Using
Int:D(4) fails now: The last snippet from the first response no longer returns
RT#126433: The mentioned issue RT#126433 -- aka #4673 has been resolved back in 2018. It also has a link with a commit that unfudges a corresponding test in roast: Raku/roast@7327b52b82214d440 So far, so clear. Only looking at those points, I'd say that this issue can be closed. But the first response also raised a spec question -- with an elaborated comment later on.
Given that question, I'll leave this issue open. |
Migrated from rt.perl.org#131791 (status was 'open')
Searchable as RT131791$
The text was updated successfully, but these errors were encountered: