Ignore:
Timestamp:
Aug 23, 2007, 6:17:00 PM (17 years ago)
Author:
dai_9181
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/src/Type.cpp

    r292 r299  
    493493
    494494
     495void ResolveFormalGenericTypeParameter( Type &typeParameter, const Type &classType, const UserProc *pUserProc )
     496{
     497    /////////////////////////////////////////////////////////
     498    // ☆★☆ ジェネリクスサポート ☆★☆
     499
     500    if( typeParameter.IsTypeParameter() )
     501    {
     502        // 型パラメータだったとき
     503
     504        // ポインタレベルを抽出
     505        int ptrLevel = PTR_LEVEL( typeParameter.GetBasicType() );
     506
     507        if( pUserProc )
     508        {
     509            // 基底クラスでの自己解決
     510            const CClass *pClass = &classType.GetClass();
     511            while( pClass->HasSuperClass() )
     512            {
     513                if( pUserProc->GetParentClassPtr() == &pClass->GetSuperClass() )
     514                {
     515                    if( pClass->GetSuperClassActualTypeParameters().size() )
     516                    {
     517                        typeParameter = pClass->GetSuperClassActualTypeParameters()[0];
     518                    }
     519                }
     520                pClass = &pClass->GetSuperClass();
     521            }
     522        }
     523
     524        if( typeParameter.IsTypeParameter() )
     525        {
     526            if( classType.HasActualGenericType() )
     527            {
     528                // TODO: GetDummyActualGenericTypeを適切な形に実装し直す
     529                typeParameter = classType.GetDummyActualGenericType();
     530            }
     531            else
     532            {
     533                // TODO: ベースオブジェクト(指定されていないときはObjectクラス)にセットする
     534                typeParameter.SetBasicType( DEF_OBJECT );
     535            }
     536        }
     537
     538        for( int i=0; i<ptrLevel; i++ )
     539        {
     540            typeParameter.PtrLevelUp();
     541        }
     542    }
     543
     544    //
     545    /////////////////////////////////////////////////////////
     546}
     547
     548
    495549const string BlittableType::GetCreateStaticMethodFullName() const
    496550{
Note: See TracChangeset for help on using the changeset viewer.