History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-260
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Rodrigo B. de Oliveira
Reporter: Philippe Quesnel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

incorrect check of void return type

Created: 25/Feb/05 12:33 PM   Updated: 23/May/05 09:06 AM
Component/s: Compiler
Affects Version/s: 0.5
Fix Version/s: 0.7

Time Tracking:
Not Specified

Environment: Windows2000, Ms .NET 1.1, Boo rel 0.5


 Description  « Hide
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



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Rodrigo B. de Oliveira - 23/Apr/05 12:07 PM
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.