ソースを参照

+ mark the def for a capturer class with a corresponding object option

Sven/Sarah Barth 2 年 前
コミット
19cee9b841
3 ファイル変更5 行追加2 行削除
  1. 1 0
      compiler/procdefutil.pas
  2. 2 1
      compiler/symconst.pas
  3. 2 1
      compiler/utils/ppuutils/ppudump.pp

+ 1 - 0
compiler/procdefutil.pas

@@ -461,6 +461,7 @@ implementation
           end;
 
           def:=cobjectdef.create(odt_class,name,parent,false);
+          include(def.objectoptions,oo_is_capturer);
           typesym:=ctypesym.create(name,def);
           typesym.fileinfo:=pd.fileinfo;
           st.insertdef(def);

+ 2 - 1
compiler/symconst.pas

@@ -569,7 +569,8 @@ type
     oo_is_enum_class,     { the class represents an enum (JVM) }
     oo_has_new_destructor,{ the object/class declares a destructor (apart from potentially inherting one from the parent) }
     oo_is_funcref,        { interface has a single Invoke method that can be directly called }
-    oo_is_invokable       { interface that is invokable like a function }
+    oo_is_invokable,      { interface that is invokable like a function }
+    oo_is_capturer        { the class is the capturer for anonymous functions (or converted proc(var)s) }
   );
   tobjectoptions=set of tobjectoption;
 

+ 2 - 1
compiler/utils/ppuutils/ppudump.pp

@@ -3244,7 +3244,8 @@ const
      (mask:oo_is_enum_class;      str:'JvmEnumClass'),
      (mask:oo_has_new_destructor; str:'HasNewDestructor'),
      (mask:oo_is_funcref;         str:'IsFuncRef'),
-     (mask:oo_is_invokable;       str:'IsInvokable')
+     (mask:oo_is_invokable;       str:'IsInvokable'),
+     (mask:oo_is_capturer;        str:'IsCapturer')
   );
 var
   i      : longint;