Boo
  1. Boo
  2. BOO-470

Void methods and string extrapolation cause Invalid Program exception

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.7
    • Component/s: Compiler
    • Labels:
      None
    • Number of attachments :
      0

      Description

      >>> def method():
      ... a = 3
      ... a++
      ...
      >>> print method()
      ----^
      ERROR: No apropriate version of 'System.Console.WriteLine' for the argument list '(System.Void)' was found.
      >>> print "$

      {method}

      "
      Input1Module
      >>> print "$

      {method()}

      "
      System.InvalidProgramException: Common Language Runtime detected an invalid program.
      at Input4Module.Main(String[] argv)

      Boo doesn't check the contents of string extrapolation parameters for void objects.
      Instead, it cast them to object and try to use them. This compiles fine, but cause an error on runtime.

        Activity

        Hide
        Rodrigo B. de Oliveira added a comment -

        Thanks!

        Show
        Rodrigo B. de Oliveira added a comment - Thanks!

          People

          • Assignee:
            Rodrigo B. de Oliveira
            Reporter:
            Ayende Rahien
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: