Browse Source

* Moved TCustomAttribute definition to system-unit
* Force ClassAttributes to inherit from TCustomAttribute for Delphi compatibility, there is no compiler-technical reason to do so

git-svn-id: branches/joost/classattributes@22756 -

joost 13 years ago
parent
commit
ac4fbdffa3
3 changed files with 7 additions and 3 deletions
  1. 4 0
      compiler/pdecl.pas
  2. 3 0
      rtl/inc/objpash.inc
  3. 0 3
      rtl/objpas/typinfo.pp

+ 4 - 0
compiler/pdecl.pas

@@ -372,6 +372,7 @@ implementation
         paras: tnode;
         paras: tnode;
         again: boolean;
         again: boolean;
         od: tobjectdef;
         od: tobjectdef;
+        classattrdef: tobjectdef;
         constrpd: tprocdef;
         constrpd: tprocdef;
         typesym: ttypesym;
         typesym: ttypesym;
         oldblock_type: tblock_type;
         oldblock_type: tblock_type;
@@ -384,6 +385,9 @@ implementation
           begin
           begin
           typesym := ttypesym(ttypenode(p).typesym);
           typesym := ttypesym(ttypenode(p).typesym);
           od := tobjectdef(ttypenode(p).typedef);
           od := tobjectdef(ttypenode(p).typedef);
+          classattrdef := tobjectdef(search_system_type('TCUSTOMATTRIBUTE').typedef);
+          if not od.is_related(classattrdef) then
+            incompatibletypes(od,classattrdef);
 
 
           { Search the tprocdef of the constructor which has to be called. }
           { Search the tprocdef of the constructor which has to be called. }
           constrpd := od.find_procdef_bytype(potype_constructor);
           constrpd := od.find_procdef_bytype(potype_constructor);

+ 3 - 0
rtl/inc/objpash.inc

@@ -334,6 +334,9 @@
          Frames     : PPointer;
          Frames     : PPointer;
        end;
        end;
 
 
+       TCustomAttribute = class(TObject)
+       end;
+
     Const
     Const
        ExceptProc : TExceptProc = Nil;
        ExceptProc : TExceptProc = Nil;
        RaiseProc : TExceptProc = Nil;
        RaiseProc : TExceptProc = Nil;

+ 0 - 3
rtl/objpas/typinfo.pp

@@ -240,9 +240,6 @@ unit typinfo;
 
 
       TProcInfoProc = Procedure(PropInfo : PPropInfo) of object;
       TProcInfoProc = Procedure(PropInfo : PPropInfo) of object;
 
 
-      TCustomAttribute = class(TObject)
-       end;
-
       TAttributeProc = function : TObject;
       TAttributeProc = function : TObject;
       PAttributeProcList = ^TAttributeProcList;
       PAttributeProcList = ^TAttributeProcList;
       TAttributeProcList = array[0..255] of TAttributeProc;
       TAttributeProcList = array[0..255] of TAttributeProc;