Boo
  1. Boo
  2. BOO-260

incorrect check of void return type

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.5
    • Fix Version/s: 0.7
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      Windows2000, Ms .NET 1.1, Boo rel 0.5
    • Number of attachments :
      0

      Description

      the compiler does not properly detect a mismatching return type when a method's / function's return type is void.

      eg1:
      import System

      // expecting 'as string' return type
      callable MyCallable(i as int) as string

      def call(cb as MyCallable):
      print cb(3)

      // incorrect return type 'void' for a MyCallable
      def func1(i as int) as void :
      print i

      call(func1) // .. compiles but crashes

      //----

      eg2:

      def foo() as void:
      print "foo"
      pa = foo() // .. compiles but crashes

        Activity

        Hide
        Rodrigo B. de Oliveira added a comment -

        The adaptation from 'callable() as void' to 'callable() as string' was correctly allowed but the generated code was wrong.

        It's fixed now. The effect is having the adaptor returning the equivalent NULL value for each type.

        Show
        Rodrigo B. de Oliveira added a comment - The adaptation from 'callable() as void' to 'callable() as string' was correctly allowed but the generated code was wrong. It's fixed now. The effect is having the adaptor returning the equivalent NULL value for each type.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: