Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Error with bad enums #5818

Open p6rt opened 7 years ago

p6rt commented 7 years ago

Migrated from rt.perl.org#130158 (status was 'new')

Searchable as RT130158$

p6rt commented 7 years ago

From @zoffixznet

From https://irclog.perlgeek.de/perl6/2016-11-23#i_13618534

15​:43 timotimo that's a cool golf 15​:43 m​: enum Foo (bar => class {}.new) 15​:43 camelia rakudo-moar 6bb882​: OUTPUT«5===SORRY!5=== Error while
compiling \␤Cannot auto-generate a proto method for 'Int' in the
setting␤at \​:1␤» 15​:43 timotimo m​: enum Foo (bar => class {}) 15​:43 camelia rakudo-moar 6bb882​: OUTPUT«5===SORRY!5=== Error while
compiling \␤Cannot auto-generate a proto method for 'Int' in the
setting␤at \​:1␤» 15​:44 viki What's cool about it? What is it trying to do? 15​:44 ZzZombo​: "setting" is what we call the core code. 15​:44 Well, part of it. 15​:45 timotimo it's trying to give us a bad error message 15​:45 viki oh 15​:45 m​: try 'enum Foo (bar => class {}.new)'.EVAL; $!.name 15​:45 camelia rakudo-moar 6bb882​: OUTPUT«No such method 'name' for
invocant of type 'X​::Comp​::AdHoc'␤ in block \ at \ line 1␤␤» 15​:45 acrussell_ joined #perl6 15​:45 viki s​: X​::Comp​::AdHoc.new, 'message', \() 15​:45 SourceBaby viki, Sauce is at
https://github.com/rakudo/rakudo/blo​b/6bb8823/src/core/Exception.pm#L124

p6rt commented 7 years ago

From @FCO

enum Bla (a => sub {})

Throws an error as you can see here​: https://irclog.perlgeek.de/perl6/2017-03-03#i_14199712

lizmat commented 2 months ago

https://github.com/rakudo/rakudo/commit/d0eb6c6f18 is a start to fixing this