From dc4f9841725f62a3cfe6d4f8873663b780fa14ff Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 20 Nov 2020 10:40:48 +0000 Subject: [PATCH] pastojs: async modifier not needed in impl --- compiler/packages/fcl-passrc/src/pasresolver.pp | 2 +- compiler/packages/pastojs/tests/tcmodules.pas | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/packages/fcl-passrc/src/pasresolver.pp b/compiler/packages/fcl-passrc/src/pasresolver.pp index b789d62..b79528c 100644 --- a/compiler/packages/fcl-passrc/src/pasresolver.pp +++ b/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; diff --git a/compiler/packages/pastojs/tests/tcmodules.pas b/compiler/packages/pastojs/tests/tcmodules.pas index 3d1402b..0e796d1 100644 --- a/compiler/packages/pastojs/tests/tcmodules.pas +++ b/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;',