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

error message: Inf.base(16) #4478

Closed
p6rt opened this issue Aug 15, 2015 · 7 comments
Closed

error message: Inf.base(16) #4478

p6rt opened this issue Aug 15, 2015 · 7 comments
Labels
LHF Low-hanging fruit, easy to resolve

Comments

@p6rt
Copy link

p6rt commented Aug 15, 2015

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

Searchable as RT125818$

@p6rt
Copy link
Author

p6rt commented Aug 15, 2015

From @AlexDaniel

Code​:
say Inf.base(16)

Result​:
Type check failed in assignment to '$int_part'; expected 'Int' but got
'Failure'
  in block <unit> at ./test.pl​:2

Same thing with NaN.

IRC log​: http://irclog.perlgeek.de/perl6/2015-08-15#i_11061555

@p6rt
Copy link
Author

p6rt commented Apr 17, 2016

From @coke

On Fri Aug 14 21​:31​:09 2015, alex.jakimenko@​gmail.com wrote​:

Code​:
say Inf.base(16)

Result​:
Type check failed in assignment to '$int_part'; expected 'Int' but got
'Failure'
in block <unit> at ./test.pl​:2

Same thing with NaN.

IRC log​: http://irclog.perlgeek.de/perl6/2015-08-15#i_11061555

This now says​:

11​:45 < [Coke]> m​: Inf.base(16)
11​:45 <+camelia> rakudo-moar 617bb4​: OUTPUT«Earlier failure​:␤ Cannot coerce Inf
  or NaN to an Int␤ in block <unit> at /tmp/NXJAFvBkuW line
  1␤␤Final error​:␤ Type check failed in assignment to $int_part;
  expected Int but got Failure (Failure.new(exception...)␤ in
  block <unit> at /tmp/NXJA…»
11​:45 < [Coke]> m​: NaN.base(16)
11​:45 <+camelia> rakudo-moar 617bb4​: OUTPUT«Earlier failure​:␤ Cannot coerce Inf
  or NaN to an Int␤ in block <unit> at /tmp/6km9xRn2h_ line
  1␤␤Final error​:␤ Type check failed in assignment to $int_part;
  expected Int but got Failure (Failure.new(exception...)␤ in
  block <unit> at /tmp/6km9…»

Which seems reasonable based on previous discussion about attempting to use non Int sentinel values as Ints.

Closable, I think.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Apr 17, 2016

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

@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

From @AlexDaniel

Nope. It is still LTA because​:
* it talks about $int_part
* it says “but got Failure (Failure.new(exception...)”

On 2016-04-17 08​:46​:47, coke wrote​:

On Fri Aug 14 21​:31​:09 2015, alex.jakimenko@​gmail.com wrote​:

Code​:
say Inf.base(16)

Result​:
Type check failed in assignment to '$int_part'; expected 'Int' but
got
'Failure'
in block <unit> at ./test.pl​:2

Same thing with NaN.

IRC log​: http://irclog.perlgeek.de/perl6/2015-08-15#i_11061555

This now says​:

11​:45 < [Coke]> m​: Inf.base(16)
11​:45 <+camelia> rakudo-moar 617bb4​: OUTPUT«Earlier failure​:␤ Cannot
coerce Inf
or NaN to an Int␤ in block <unit> at /tmp/NXJAFvBkuW
line
1␤␤Final error​:␤ Type check failed in assignment to
$int_part;
expected Int but got Failure
(Failure.new(exception...)␤ in
block <unit> at /tmp/NXJA…»
11​:45 < [Coke]> m​: NaN.base(16)
11​:45 <+camelia> rakudo-moar 617bb4​: OUTPUT«Earlier failure​:␤ Cannot
coerce Inf
or NaN to an Int␤ in block <unit> at /tmp/6km9xRn2h_
line
1␤␤Final error​:␤ Type check failed in assignment to
$int_part;
expected Int but got Failure
(Failure.new(exception...)␤ in
block <unit> at /tmp/6km9…»

Which seems reasonable based on previous discussion about attempting
to use non Int sentinel values as Ints.

Closable, I think.

@p6rt
Copy link
Author

p6rt commented Oct 4, 2017

From @zoffixznet

♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
For SQUASHathoners​:
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥

Just need to add `.self` to this method call here​: https://github.com/rakudo/rakudo/blob/98fae3d84/src/core/Real.pm#L92

It will explode the Failure form .Int coercion and result in a better error.

@p6rt
Copy link
Author

p6rt commented Oct 4, 2017

From @zoffixznet

On Fri, 14 Aug 2015 21​:31​:09 -0700, alex.jakimenko@​gmail.com wrote​:

Code​:
say Inf.base(16)

Result​:
Type check failed in assignment to '$int_part'; expected 'Int' but got
'Failure'
in block <unit> at ./test.pl​:2

Same thing with NaN.

IRC log​: http://irclog.perlgeek.de/perl6/2015-08-15#i_11061555

This is now fixed.
Fixes​: rakudo/rakudo@38186fcdf7
  rakudo/rakudo@2e72652826
  rakudo/rakudo@f04bd1d617
Tests​: Raku/roast@48ea502f0d

@p6rt
Copy link
Author

p6rt commented Oct 4, 2017

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

@p6rt p6rt closed this as completed Oct 4, 2017
@p6rt p6rt added the LHF Low-hanging fruit, easy to resolve label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LHF Low-hanging fruit, easy to resolve
Projects
None yet
Development

No branches or pull requests

1 participant