Changeset 116 in dev for BasicCompiler32


Ignore:
Timestamp:
May 12, 2007, 4:34:39 PM (17 years ago)
Author:
dai_9181
Message:

暗黙的なアップキャストを可能にした

Location:
BasicCompiler32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/Compile_Calc.cpp

    r75 r116  
    606606
    607607    if( calcType.IsObject() && !calcType.Equals( varType ) ){
    608         //キャスト演算子のオーバーロードに対応する
    609         CallCastOperatorProc(calcType,bCalcUseHeap,varType);
     608        bool isUpCast = false;
     609        if( varType.IsObject() ){
     610            if( varType.GetClass().IsEqualsOrSubClass( &calcType.GetClass() ) ){
     611                isUpCast = true;
     612            }
     613        }
     614        if( !isUpCast ){
     615            //キャスト演算子のオーバーロードに対応する
     616            CallCastOperatorProc(calcType,bCalcUseHeap,varType);
     617        }
    610618    }
    611619
  • BasicCompiler32/Compile_Var.cpp

    r106 r116  
    513513                CClass::RefType refType;
    514514                GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember, refType );
     515            }
     516
     517            int typeDefIndex = Smoothie::Meta::typeDefs.GetIndex( VarName );
     518            if( typeDefIndex != -1 ){
     519                // TypeDef後の型名だったとき
     520                lstrcpy( VarName, Smoothie::Meta::typeDefs[typeDefIndex].GetBaseName().c_str() );
    515521            }
    516522
Note: See TracChangeset for help on using the changeset viewer.