From 0bbda31b252a63c0fdbd2d59570d15045922c714 Mon Sep 17 00:00:00 2001 From: Friedrich Weber Date: Sat, 5 Feb 2011 18:21:44 +0100 Subject: [PATCH] Derived types with functions taking functypes as arguments: Eliminated TODO. Closes #275. Thank you for reporting! --- source/rock/middle/FunctionDecl.ooc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/rock/middle/FunctionDecl.ooc b/source/rock/middle/FunctionDecl.ooc index e8ed3380..d15e0cd7 100644 --- a/source/rock/middle/FunctionDecl.ooc +++ b/source/rock/middle/FunctionDecl.ooc @@ -473,12 +473,16 @@ FunctionDecl: class extends Declaration { if(debugCondition()) "Got -1 from finalScore!" println() return Response OK } + parentArgs := parent args getSize() // todo: check for finalScore for(i in 0..args getSize()) { arg := args[i] if(arg getType() instanceOf?(FuncType)) { fType1 := arg getType() as FuncType - // TODO: add check 1) number of argument 2) it's a FuncType + // check 1) number of argument 2) it's a FuncType + if(parentArgs <= i || !parent args[i] getType() instanceOf?(FuncType)) { + break + } fType2 := parent args[i] getType() as FuncType //"for %s, got %s vs %s" printfln(toString(), fType1 toString(), fType2 toString())