瀏覽代碼

pastojs: async modifier not needed in impl

mattias 4 年之前
父節點
當前提交
dc4f984172
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      compiler/packages/fcl-passrc/src/pasresolver.pp
  2. 1 1
      compiler/packages/pastojs/tests/tcmodules.pas

+ 1 - 1
compiler/packages/fcl-passrc/src/pasresolver.pp

@@ -9467,7 +9467,7 @@ begin
       RaiseIncompatibleType(20170216151734,nResultTypeMismatchExpectedButFound,
         [],DeclResult,ImplResult,ImplProc);
 
-    if ImplProc.IsAsync<>DeclProc.IsAsync then
+    if ImplProc.IsAsync and not DeclProc.IsAsync then
       RaiseMsg(20200524111856,nXModifierMismatchY,sXModifierMismatchY,['procedure type','async'],ImplProc);
     end;
 

+ 1 - 1
compiler/packages/pastojs/tests/tcmodules.pas

@@ -32694,7 +32694,7 @@ begin
   'function TObject.Run(w: word = 3): word; async;',
   'begin',
   'end;',
-  'function TBird.Run(w: word = 3): word; async;',
+  'function TBird.Run(w: word = 3): word;', // async modifier not needed in impl
   'var p: TJSPromise;',
   'begin',
   '  p:=inherited;',