diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 94838aba75c54075fc69464557567175bedcdafd..fa852ad075a98251989b00e22951ea0af63d0a5a 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -166,9 +166,15 @@ function checkComponentDecorator(source: string, filePath: string, addLog(LogType.ERROR, message, pos, log, sourceFile); } } - if (ts.isMissingDeclaration(item) && /struct/.test(item.getText())) { - const message: string = `Please use a valid decorator.`; - addLog(LogType.ERROR, message, item.getStart(), log, sourceFile); + if (ts.isMissingDeclaration(item)) { + const decorators: ts.NodeArray = item.decorators; + for (let i = 0; i < decorators.length; i++) { + if (decorators[i] && /struct/.test(item.getText())) { + const message: string = `Please use a valid decorator.`; + addLog(LogType.ERROR, message, item.getStart(), log, sourceFile); + break; + } + } } }); validateEntryCount(result, fileQuery, sourceFile.fileName, log); @@ -379,11 +385,17 @@ function getBlockChildrenCount(blockNode: ts.Block, allComponentNames: Set 1) { @@ -482,15 +494,21 @@ function isNonspecificChildBlock(blockNode: ts.Block, specificChildSet: Set