Changeset 59 in dev for BasicCompiler_Common/error.cpp


Ignore:
Timestamp:
Feb 21, 2007, 1:50:32 AM (17 years ago)
Author:
dai_9181
Message:

派生クラスから基底クラスへのインスタンスコピーまたは参照を可能にした

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/error.cpp

    r46 r59  
    399399
    400400    if(VarType==DEF_OBJECT||CalcType==DEF_OBJECT){
    401         //オブジェクトインスタンスの場合
    402         if(!(VarType==CalcType&&lpVarIndex==lpCalcIndex)){
     401        //いずれかがオブジェクトインスタンスの場合
     402        if( VarType != CalcType ){
     403            DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,3,pszFuncName,ParmNum);
     404            return false;
     405        }
     406
     407        CClass *pClass = (CClass *)lpVarIndex;
     408        if( !pClass->IsEqualsOrSubClass( (CClass *)lpCalcIndex ) ){
     409            //等しくなく、派生クラスでもないとき
    403410            DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,3,pszFuncName,ParmNum);
    404411            return false;
Note: See TracChangeset for help on using the changeset viewer.