From 124a4859e0b25040284453392d77f0b788739bc8 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Mon, 30 Sep 2013 00:22:24 -0400 Subject: [PATCH] compiler/libec: (#141) Fixed Not enough/Too many warnings/errors - Added a check for functionType.extraParam --- compiler/bootstrap/libec/bootstrap/pass15.c | 2 +- compiler/libec/src/ecdefs.ec | 4 ++-- compiler/libec/src/pass15.ec | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/bootstrap/libec/bootstrap/pass15.c b/compiler/bootstrap/libec/bootstrap/pass15.c index 1e875d0..c92dcac 100644 --- a/compiler/bootstrap/libec/bootstrap/pass15.c +++ b/compiler/bootstrap/libec/bootstrap/pass15.c @@ -13683,7 +13683,7 @@ if(functionType->extraParam && e && functionType->thisClass) e->destType = MkClassType(functionType->thisClass->string); e = e->next; } -if(!functionType->staticMethod) +if(!functionType->staticMethod && !functionType->extraParam) { if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class) { diff --git a/compiler/libec/src/ecdefs.ec b/compiler/libec/src/ecdefs.ec index 34456a2..98f3c0a 100644 --- a/compiler/libec/src/ecdefs.ec +++ b/compiler/libec/src/ecdefs.ec @@ -1130,7 +1130,7 @@ public: struct { Method method; - Class methodClass; + Class methodClass; // Clarify what this is! Class usedClass; }; @@ -1162,7 +1162,7 @@ public: bool constant:1; bool truth:1; bool byReference:1; - bool extraParam:1; + bool extraParam:1; // Clarify this... One thing it is used for is adaptive method with their own type explicitly specified bool directClassAccess:1; // Need to clarify this if this had the same intended purpose as declaredWithStruct bool computing:1; bool keepCast:1; diff --git a/compiler/libec/src/pass15.ec b/compiler/libec/src/pass15.ec index 60d0b8b..6d93422 100644 --- a/compiler/libec/src/pass15.ec +++ b/compiler/libec/src/pass15.ec @@ -8813,7 +8813,8 @@ void ProcessExpressionType(Expression exp) } // WHY WAS THIS COMMENTED OUT ? Broke DisplaySystem::FontExtent(this ? displaySystem : null, font, text, len, width, height); - if(!functionType.staticMethod) + // Fixed #141 by adding '&& !functionType.extraParam' + if(!functionType.staticMethod && !functionType.extraParam) { if(memberExp && memberExp.member.exp && memberExp.member.exp.expType && memberExp.member.exp.expType.kind == subClassType && memberExp.member.exp.expType._class) -- 1.8.3.1