#886 User string methods can cause problems if returning a number

v4.0.1
closed
Rick McGuire
5
2012-08-14
2010-02-22
Rick McGuire
No

The interpreter can run into problems if a user-defined string method returns a numeric value. The internal string processing does not force that value to be a true string, which can cause unexpected results or even crashes. The following simple program can demonstrate the problem:

say "This is a test" .test~new

::class test
::method string
return 123

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2010-02-24

    I don't know why changing the group to v4.0.1 should change the status
    from pending to open, under the covers. And, I don't know why it does for some, and not for others.

     


Anonymous


Cancel   Add attachments