From 91692e7be65fcf9a89155a44cdf168290da11f57 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 14 Jan 2010 09:11:48 +0000 Subject: [PATCH] 2010-01-14 10:11 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbclass.ch ! fixed compilation with strong typed parameters in method implementation * enable strict parameters validation only when method is declared with (), i.e.: method open does not force any parameter validation so it can be implemented with any parameters but: method open() needs open method implementation with only one parameter and: method open( file ) needs open method implementation with exactly one parameter 'file' --- harbour/ChangeLog | 14 ++++++++++++++ harbour/include/hbclass.ch | 12 +++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index dfb4e1b2c4..205115f3fe 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,20 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-14 10:11 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbclass.ch + ! fixed compilation with strong typed parameters in method + implementation + * enable strict parameters validation only when method is declared + with (), i.e.: + method open + does not force any parameter validation so it can be implemented + with any parameters but: + method open() + needs open method implementation with only one parameter and: + method open( file ) + needs open method implementation with exactly one parameter 'file' + 2010-01-14 00:57 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/gtwvg/wvg3stat.prg * contrib/gtwvg/wvgax.prg diff --git a/harbour/include/hbclass.ch b/harbour/include/hbclass.ch index 9c6347cf4f..cd06ee93e9 100644 --- a/harbour/include/hbclass.ch +++ b/harbour/include/hbclass.ch @@ -193,7 +193,7 @@ #define __HB_CLS_NOINI .F. #endif -/* Should we generate compile error when method declaration has differ parameters? */ +/* Should we generate compile error when method declaration has different parameters? */ #ifdef HB_CLS_NO_PARAMS_ERR #xtranslate __HB_CLS_PARAMS() => __HB_CLS_ASID() #else @@ -299,8 +299,14 @@ DECLARE HBClass ; local Self AS CLASS := QSelf() AS CLASS #xcommand __HB_CLS_DECLARE_METHOD => ; - #xcommand METHOD \ \[(\[\])] CLASS _CLASS_IMPLEMENTATION_ => ; - DECLARED METHOD \ \[(\)] CLASS + #xcommand METHOD \ CLASS _CLASS_IMPLEMENTATION_ => ; + DECLARED METHOD \ CLASS + +#xcommand __HB_CLS_DECLARE_METHOD => ; + #xcommand METHOD \ CLASS _CLASS_IMPLEMENTATION_ => ; + DECLARED METHOD \ CLASS ;; + #xcommand METHOD \ (\[ \] ) CLASS _CLASS_IMPLEMENTATION_ => ; + DECLARED METHOD \ (\[ \] ) CLASS #xcommand METHOD CLASS _CLASS_IMPLEMENTATION_ => ; __HB_CLS_ERR( Method not declared or declaration mismatch in class: ) ;;