diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-01-21 23:28:34 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-01-21 23:28:34 +0000 |
commit | 1903b037de2fb3e75826406b46f055acb70963fa (patch) | |
tree | 604cd8b790fe14e5fbe441d4cd647c80d2a36a9a /compiler/ptype.pas | |
parent | ad1141d52f8353457053b925cd674fe1d5c4eafc (diff) | |
parent | 953d907e4d6c3a5c2f8aaee6e5e4f73c55ce5985 (diff) | |
download | fpc-blocks.tar.gz |
* synchronised with trunk till r29513blocks
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/blocks@29516 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ptype.pas')
-rw-r--r-- | compiler/ptype.pas | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/compiler/ptype.pas b/compiler/ptype.pas index 4b316a47a2..e099261edf 100644 --- a/compiler/ptype.pas +++ b/compiler/ptype.pas @@ -340,7 +340,11 @@ implementation ((ttypesym(srsym).typedef.typ=errordef) or (not allowgenericsyms and (ttypesym(srsym).typedef.typ=undefineddef) and - not (sp_generic_para in srsym.symoptions))) then + not (sp_generic_para in srsym.symoptions) and + not (sp_explicitrename in srsym.symoptions) and + not assigned(srsym.owner.defowner) and + { use df_generic instead of is_generic to allow aliases in nested types as well } + not (df_generic in tstoreddef(srsym.owner.defowner).defoptions))) then begin Message1(type_e_type_is_not_completly_defined,ttypesym(srsym).realname); def:=generrordef; @@ -1040,39 +1044,39 @@ implementation without "specialize" or "<T>" of the same type we're currently parsing, so we need to handle that special } newdef:=nil; - if not dospecialize and - assigned(ttypenode(pt1).typesym) and - (ttypenode(pt1).typesym.typ=typesym) and - (sp_generic_dummy in ttypenode(pt1).typesym.symoptions) and - assigned(current_structdef) and + if not dospecialize and + assigned(ttypenode(pt1).typesym) and + (ttypenode(pt1).typesym.typ=typesym) and + (sp_generic_dummy in ttypenode(pt1).typesym.symoptions) and + assigned(current_structdef) and + ( ( - ( - not (m_delphi in current_settings.modeswitches) and - (ttypesym(ttypenode(pt1).typesym).typedef.typ=undefineddef) and - (df_generic in current_structdef.defoptions) and - (ttypesym(ttypenode(pt1).typesym).typedef.owner=current_structdef.owner) and - (upper(ttypenode(pt1).typesym.realname)=copy(current_structdef.objname^,1,pos('$',current_structdef.objname^)-1)) - ) or ( - { this could be a nested specialization which uses - the type name of a surrounding generic to - reference the specialization of said surrounding - class } - (df_specialization in current_structdef.defoptions) and - return_specialization_of_generic(current_structdef,ttypesym(ttypenode(pt1).typesym).typedef,newdef) - ) + not (m_delphi in current_settings.modeswitches) and + (ttypesym(ttypenode(pt1).typesym).typedef.typ=undefineddef) and + (df_generic in current_structdef.defoptions) and + (ttypesym(ttypenode(pt1).typesym).typedef.owner=current_structdef.owner) and + (upper(ttypenode(pt1).typesym.realname)=copy(current_structdef.objname^,1,pos('$',current_structdef.objname^)-1)) + ) or ( + { this could be a nested specialization which uses + the type name of a surrounding generic to + reference the specialization of said surrounding + class } + (df_specialization in current_structdef.defoptions) and + return_specialization_of_generic(current_structdef,ttypesym(ttypenode(pt1).typesym).typedef,newdef) ) - then - begin - if assigned(newdef) then - def:=newdef - else - def:=current_structdef; - if assigned(def) then - { handle nested types } - post_comp_expr_gendef(def) - else - def:=generrordef; - end; + ) + then + begin + if assigned(newdef) then + def:=newdef + else + def:=current_structdef; + if assigned(def) then + { handle nested types } + post_comp_expr_gendef(def) + else + def:=generrordef; + end; if dospecialize then begin generate_specialization(def,false,name); |