Browse Source

pastojs: async modifier not needed in impl

mattias 4 years ago
parent
commit
dc4f984172

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

@@ -9467,7 +9467,7 @@ begin
       RaiseIncompatibleType(20170216151734,nResultTypeMismatchExpectedButFound,
       RaiseIncompatibleType(20170216151734,nResultTypeMismatchExpectedButFound,
         [],DeclResult,ImplResult,ImplProc);
         [],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);
       RaiseMsg(20200524111856,nXModifierMismatchY,sXModifierMismatchY,['procedure type','async'],ImplProc);
     end;
     end;
 
 

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

@@ -32694,7 +32694,7 @@ begin
   'function TObject.Run(w: word = 3): word; async;',
   'function TObject.Run(w: word = 3): word; async;',
   'begin',
   'begin',
   'end;',
   '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;',
   'var p: TJSPromise;',
   'begin',
   'begin',
   '  p:=inherited;',
   '  p:=inherited;',