[perl #128880] [BUG] Dead code in HyperWhatev er, 「.new」 is not supposed to work but it does (HyperWhatever.new)

[email protected] ("Zoffix Znet via RT")
Newsgroups perl.perl6.compiler
Message-ID <[email protected]>
On Tue, 09 Aug 2016 15:25:11 -0700, [email protected] wrote:
> Let's look at the code in Rakudo! From src/core/Whatever.pm
> 
> my class HyperWhatever {
> multi method new(HyperWhatever:) { X::Cannot::New.new(class =>
> self).throw }
> …
> }
> 
> So it seems like it should throw a warning if we try to create a
> HyperWhatever
> object, right? Let's see!
> 
> Code:
> say HyperWhatever.new
> 
> Result:
> sub (*@_) { #`(Sub|54745104) ... }
> 
> 
> Apparently, the code in “.new” method of Whatever.pm is not being
> reached.


Thank you for the report. This is now fixed.

Fix:  https://github.com/rakudo/rakudo/commit/57a1aa7a87
Test: https://github.com/perl6/roast/commit/dbe43e171d7a


On Thu, 11 Aug 2016 20:41:53 -0700, [email protected] wrote:
> Bizarrely, SourceBaby points to the right place, so I don't get why it
> doesn't work:
> https://github.com/rakudo/rakudo/blob/c587b9d/src/core/Whatever.pm#L10

On Sun, 18 Dec 2016 13:18:36 -0800, [email protected] wrote:
> No idea if there's any easy way to make it DTRT, so I'm going to leave
> this for someone else...

It's OK, 2016-Zoffix. I got your back, bruh.
Took me like 3 minutes to figure out the fix.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.