From 342e049b6dc8710d65f4c986cf54568e3e5cc6d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Mar 2021 06:57:59 -0500 Subject: [PATCH 01/11] Bump @types/react from 16.14.4 to 16.14.5 in /src/playground (#1769) Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 16.14.4 to 16.14.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/playground/package-lock.json | 12 +++++++++--- src/playground/package.json | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/playground/package-lock.json b/src/playground/package-lock.json index e9dc70e86ea..0480ebd2589 100644 --- a/src/playground/package-lock.json +++ b/src/playground/package-lock.json @@ -257,11 +257,12 @@ "dev": true }, "@types/react": { - "version": "16.14.4", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.4.tgz", - "integrity": "sha512-ETj7GbkPGjca/A4trkVeGvoIakmLV6ZtX3J8dcmOpzKzWVybbrOxanwaIPG71GZwImoMDY6Fq4wIe34lEqZ0FQ==", + "version": "16.14.5", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.5.tgz", + "integrity": "sha512-YRRv9DNZhaVTVRh9Wmmit7Y0UFhEVqXqCSw3uazRWMxa2x85hWQZ5BN24i7GXZbaclaLXEcodEeIHsjBA8eAMw==", "requires": { "@types/prop-types": "*", + "@types/scheduler": "*", "csstype": "^3.0.2" } }, @@ -282,6 +283,11 @@ "@types/react": "*" } }, + "@types/scheduler": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.1.tgz", + "integrity": "sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==" + }, "@types/serve-static": { "version": "1.13.8", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.8.tgz", diff --git a/src/playground/package.json b/src/playground/package.json index 0cca4454f90..a8b25b7b06b 100644 --- a/src/playground/package.json +++ b/src/playground/package.json @@ -15,7 +15,7 @@ "@types/copy-webpack-plugin": "^6.4.0", "@types/node": "^14.14.31", "@types/pako": "^1.0.1", - "@types/react": "^16.14.4", + "@types/react": "^16.14.5", "@types/react-dom": "^17.0.1", "@types/webpack": "^4.41.26", "@types/webpack-dev-server": "^3.11.1", From 918f11ff6672fa0369c3d2d344c7850ed604cc3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Mar 2021 06:58:07 -0500 Subject: [PATCH 02/11] Bump @types/node from 14.14.31 to 14.14.32 in /src/playground (#1768) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.31 to 14.14.32. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/playground/package-lock.json | 6 +++--- src/playground/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/playground/package-lock.json b/src/playground/package-lock.json index 0480ebd2589..4d59c30f8e7 100644 --- a/src/playground/package-lock.json +++ b/src/playground/package-lock.json @@ -228,9 +228,9 @@ "dev": true }, "@types/node": { - "version": "14.14.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", - "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==", + "version": "14.14.32", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.32.tgz", + "integrity": "sha512-/Ctrftx/zp4m8JOujM5ZhwzlWLx22nbQJiVqz8/zE15gOeEW+uly3FSX4fGFpcfEvFzXcMCJwq9lGVWgyARXhg==", "dev": true }, "@types/pako": { diff --git a/src/playground/package.json b/src/playground/package.json index a8b25b7b06b..976af0feb99 100644 --- a/src/playground/package.json +++ b/src/playground/package.json @@ -13,7 +13,7 @@ "license": "ISC", "devDependencies": { "@types/copy-webpack-plugin": "^6.4.0", - "@types/node": "^14.14.31", + "@types/node": "^14.14.32", "@types/pako": "^1.0.1", "@types/react": "^16.14.5", "@types/react-dom": "^17.0.1", From 4eebf82d38d9ec6e32a6452aae4257f3589c5f90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Mar 2021 06:58:14 -0500 Subject: [PATCH 03/11] Bump html-webpack-plugin from 5.2.0 to 5.3.0 in /src/playground (#1767) Bumps [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/jantimon/html-webpack-plugin/releases) - [Changelog](https://github.com/jantimon/html-webpack-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/jantimon/html-webpack-plugin/compare/v5.2.0...v5.3.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/playground/package-lock.json | 7 +++---- src/playground/package.json | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/playground/package-lock.json b/src/playground/package-lock.json index 4d59c30f8e7..79bdab3348e 100644 --- a/src/playground/package-lock.json +++ b/src/playground/package-lock.json @@ -2632,14 +2632,13 @@ } }, "html-webpack-plugin": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.2.0.tgz", - "integrity": "sha512-0wkVlJKq7edCN793gdLgdAm5m196qI2vb5SGXy4AtGOFB/lYKyS10+3Vkhe6Bo0acddAW3QVw+0ysgWoko/IEQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.3.0.tgz", + "integrity": "sha512-BjtSQCy5J0e9EDV+NZ4i+w36N9avXfQDF4QoAV9YAECG50x6/2tfJkFb0ws9eTcszLdyg4vs6FI6hMgVzVoQqw==", "dev": true, "requires": { "@types/html-minifier-terser": "^5.0.0", "html-minifier-terser": "^5.0.1", - "loader-utils": "^2.0.0", "lodash": "^4.17.20", "pretty-error": "^2.1.1", "tapable": "^2.0.0" diff --git a/src/playground/package.json b/src/playground/package.json index 976af0feb99..786dfaa46d0 100644 --- a/src/playground/package.json +++ b/src/playground/package.json @@ -22,7 +22,7 @@ "copy-webpack-plugin": "^8.0.0", "css-loader": "^5.1.1", "file-loader": "^6.2.0", - "html-webpack-plugin": "^5.2.0", + "html-webpack-plugin": "^5.3.0", "monaco-editor-webpack-plugin": "^2.1.0", "nerdbank-gitversioning": "^3.3.37", "style-loader": "^2.0.0", From e634b518f03bc26c752a8af42b02db4ac61144fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Mar 2021 06:58:22 -0500 Subject: [PATCH 04/11] Bump @types/node from 14.14.31 to 14.14.32 in /src/vscode-bicep (#1766) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.31 to 14.14.32. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/vscode-bicep/package-lock.json | 6 +++--- src/vscode-bicep/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vscode-bicep/package-lock.json b/src/vscode-bicep/package-lock.json index c8c7d12f99a..fae621d6d7d 100644 --- a/src/vscode-bicep/package-lock.json +++ b/src/vscode-bicep/package-lock.json @@ -1178,9 +1178,9 @@ "dev": true }, "@types/node": { - "version": "14.14.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", - "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==" + "version": "14.14.32", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.32.tgz", + "integrity": "sha512-/Ctrftx/zp4m8JOujM5ZhwzlWLx22nbQJiVqz8/zE15gOeEW+uly3FSX4fGFpcfEvFzXcMCJwq9lGVWgyARXhg==" }, "@types/node-fetch": { "version": "2.5.8", diff --git a/src/vscode-bicep/package.json b/src/vscode-bicep/package.json index 115f9a43167..724bb3c07de 100644 --- a/src/vscode-bicep/package.json +++ b/src/vscode-bicep/package.json @@ -95,7 +95,7 @@ "devDependencies": { "@types/jest": "^26.0.20", "@types/mocha": "^8.2.1", - "@types/node": "^14.14.31", + "@types/node": "^14.14.32", "@types/semver": "^7.3.4", "@types/triple-beam": "^1.3.2", "@types/vscode": "^1.52.0", From 900e1a66b95819b46ed4b5a47743a48cfff4aa61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Mar 2021 06:58:29 -0500 Subject: [PATCH 05/11] Bump eslint-plugin-jest from 24.1.5 to 24.1.8 in /src/vscode-bicep (#1764) Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.1.5 to 24.1.8. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v24.1.5...v24.1.8) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/vscode-bicep/package-lock.json | 52 +++++++++++++++--------------- src/vscode-bicep/package.json | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/vscode-bicep/package-lock.json b/src/vscode-bicep/package-lock.json index fae621d6d7d..c5a6cc9b4fc 100644 --- a/src/vscode-bicep/package-lock.json +++ b/src/vscode-bicep/package-lock.json @@ -1396,15 +1396,15 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.15.1.tgz", - "integrity": "sha512-9LQRmOzBRI1iOdJorr4jEnQhadxK4c9R2aEAsm7WE/7dq8wkKD1suaV0S/JucTL8QlYUPU1y2yjqg+aGC0IQBQ==", + "version": "4.16.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.16.1.tgz", + "integrity": "sha512-0Hm3LSlMYFK17jO4iY3un1Ve9x1zLNn4EM50Lia+0EV99NdbK+cn0er7HC7IvBA23mBg3P+8dUkMXy4leL33UQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.15.1", - "@typescript-eslint/types": "4.15.1", - "@typescript-eslint/typescript-estree": "4.15.1", + "@typescript-eslint/scope-manager": "4.16.1", + "@typescript-eslint/types": "4.16.1", + "@typescript-eslint/typescript-estree": "4.16.1", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } @@ -1471,29 +1471,29 @@ } }, "@typescript-eslint/scope-manager": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.15.1.tgz", - "integrity": "sha512-ibQrTFcAm7yG4C1iwpIYK7vDnFg+fKaZVfvyOm3sNsGAerKfwPVFtYft5EbjzByDJ4dj1WD8/34REJfw/9wdVA==", + "version": "4.16.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.16.1.tgz", + "integrity": "sha512-6IlZv9JaurqV0jkEg923cV49aAn8V6+1H1DRfhRcvZUrptQ+UtSKHb5kwTayzOYTJJ/RsYZdcvhOEKiBLyc0Cw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.15.1", - "@typescript-eslint/visitor-keys": "4.15.1" + "@typescript-eslint/types": "4.16.1", + "@typescript-eslint/visitor-keys": "4.16.1" } }, "@typescript-eslint/types": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.15.1.tgz", - "integrity": "sha512-iGsaUyWFyLz0mHfXhX4zO6P7O3sExQpBJ2dgXB0G5g/8PRVfBBsmQIc3r83ranEQTALLR3Vko/fnCIVqmH+mPw==", + "version": "4.16.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.16.1.tgz", + "integrity": "sha512-nnKqBwMgRlhzmJQF8tnFDZWfunXmJyuXj55xc8Kbfup4PbkzdoDXZvzN8//EiKR27J6vUSU8j4t37yUuYPiLqA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.1.tgz", - "integrity": "sha512-z8MN3CicTEumrWAEB2e2CcoZa3KP9+SMYLIA2aM49XW3cWIaiVSOAGq30ffR5XHxRirqE90fgLw3e6WmNx5uNw==", + "version": "4.16.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.16.1.tgz", + "integrity": "sha512-m8I/DKHa8YbeHt31T+UGd/l8Kwr0XCTCZL3H4HMvvLCT7HU9V7yYdinTOv1gf/zfqNeDcCgaFH2BMsS8x6NvJg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.15.1", - "@typescript-eslint/visitor-keys": "4.15.1", + "@typescript-eslint/types": "4.16.1", + "@typescript-eslint/visitor-keys": "4.16.1", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -1502,12 +1502,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.1.tgz", - "integrity": "sha512-tYzaTP9plooRJY8eNlpAewTOqtWW/4ff/5wBjNVaJ0S0wC4Gpq/zDVRTJa5bq2v1pCNQ08xxMCndcvR+h7lMww==", + "version": "4.16.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.16.1.tgz", + "integrity": "sha512-s/aIP1XcMkEqCNcPQtl60ogUYjSM8FU2mq1O7y5cFf3Xcob1z1iXWNB6cC43Op+NGRTFgGolri6s8z/efA9i1w==", "dev": true, "requires": { - "@typescript-eslint/types": "4.15.1", + "@typescript-eslint/types": "4.16.1", "eslint-visitor-keys": "^2.0.0" }, "dependencies": { @@ -3362,9 +3362,9 @@ "dev": true }, "eslint-plugin-jest": { - "version": "24.1.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.1.5.tgz", - "integrity": "sha512-FIP3lwC8EzEG+rOs1y96cOJmMVpdFNreoDJv29B5vIupVssRi8zrSY3QadogT0K3h1Y8TMxJ6ZSAzYUmFCp2hg==", + "version": "24.1.8", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.1.8.tgz", + "integrity": "sha512-0ZU0d4ohDF/ibC1RT/VJQY4orrFw0tyaGBWET09yB/V7ilnjKENSPFSGaLp3u0KHGiNDhZZKe+ZbWSAwy2Sffg==", "dev": true, "requires": { "@typescript-eslint/experimental-utils": "^4.0.1" diff --git a/src/vscode-bicep/package.json b/src/vscode-bicep/package.json index 724bb3c07de..edc4a99195c 100644 --- a/src/vscode-bicep/package.json +++ b/src/vscode-bicep/package.json @@ -105,7 +105,7 @@ "eslint": "^7.21.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-header": "^3.1.1", - "eslint-plugin-jest": "^24.1.5", + "eslint-plugin-jest": "^24.1.8", "eslint-plugin-prettier": "^3.3.1", "jest": "^26.6.2", "nerdbank-gitversioning": "^3.3.37", From d42c1e2d1d1b7a810fc98ed72283b6e61bd338f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Mar 2021 06:58:35 -0500 Subject: [PATCH 06/11] Bump vscode-azureextensionui from 0.39.4 to 0.39.5 in /src/vscode-bicep (#1765) Bumps [vscode-azureextensionui](https://github.com/Microsoft/vscode-azuretools) from 0.39.4 to 0.39.5. - [Release notes](https://github.com/Microsoft/vscode-azuretools/releases) - [Commits](https://github.com/Microsoft/vscode-azuretools/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/vscode-bicep/package-lock.json | 12 ++++++------ src/vscode-bicep/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vscode-bicep/package-lock.json b/src/vscode-bicep/package-lock.json index c5a6cc9b4fc..e6846855ba5 100644 --- a/src/vscode-bicep/package-lock.json +++ b/src/vscode-bicep/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@azure/abort-controller": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.3.tgz", - "integrity": "sha512-kCibMwqffnwlw3c+e879rCE1Am1I2BfhjOeO54XNA8i/cEuzktnBQbTrzh67XwibHO05YuNgZzSWy9ocVfFAGw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz", + "integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==", "requires": { "tslib": "^2.0.0" }, @@ -9010,9 +9010,9 @@ } }, "vscode-azureextensionui": { - "version": "0.39.4", - "resolved": "https://registry.npmjs.org/vscode-azureextensionui/-/vscode-azureextensionui-0.39.4.tgz", - "integrity": "sha512-ht7ZSzMXSKHDSwGA3nWtisqrNom3kg5HaeZfRp0rDdx47HNlldxtsKieLyWy7E4AeS6+BFX4px9GRXcGhnGoQQ==", + "version": "0.39.5", + "resolved": "https://registry.npmjs.org/vscode-azureextensionui/-/vscode-azureextensionui-0.39.5.tgz", + "integrity": "sha512-2A2FVCEneJcK5qyYRvNAC1SJrbKgns93eJPK6/5hnDYc3W25QvTSPagvrPg4XyL/nFxHwUVqQGANvP/btk8ehw==", "requires": { "@azure/arm-resources": "^3.0.0", "@azure/arm-storage": "^15.0.0", diff --git a/src/vscode-bicep/package.json b/src/vscode-bicep/package.json index edc4a99195c..0ade70eadd6 100644 --- a/src/vscode-bicep/package.json +++ b/src/vscode-bicep/package.json @@ -122,7 +122,7 @@ }, "dependencies": { "triple-beam": "^1.3.0", - "vscode-azureextensionui": "^0.39.4", + "vscode-azureextensionui": "^0.39.5", "vscode-languageclient": "^7.0.0", "winston": "^3.3.3", "winston-transport": "^4.4.0" From 28bc5d29dff6f2380cb522e5ba73ea8d2951623a Mon Sep 17 00:00:00 2001 From: Anthony Martin Date: Mon, 8 Mar 2021 10:19:20 -0500 Subject: [PATCH 07/11] Avoid unhandled exception for duplicate properties (#1771) --- .../ScenarioTests.cs | 21 ++++++++++++++++++- .../TypeSystem/DeployTimeConstantVisitor.cs | 6 ++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Bicep.Core.IntegrationTests/ScenarioTests.cs b/src/Bicep.Core.IntegrationTests/ScenarioTests.cs index 7c8323a1811..de67d79d066 100644 --- a/src/Bicep.Core.IntegrationTests/ScenarioTests.cs +++ b/src/Bicep.Core.IntegrationTests/ScenarioTests.cs @@ -889,6 +889,25 @@ param stampLocations array { diags.Should().ContainDiagnostic("BCP052", DiagnosticLevel.Error, "The type \"outputs\" does not contain property \"cosmosDbEndpoint\"."); diags.Should().ContainDiagnostic("BCP052", DiagnosticLevel.Error, "The type \"outputs\" does not contain property \"cosmosDbKey\"."); } - } + + [TestMethod] + public void Test_Issue1432() + { + var (template, diags, _) = CompilationHelper.Compile(@" +resource foo 'Microsoft.Compute/virtualMachines@2020-06-01' = { + name: 'myVM' + name: 'myVm' } +"); + using (new AssertionScope()) + { + template!.Should().BeNull(); + diags.Should().HaveDiagnostics(new[] { + ("BCP025", DiagnosticLevel.Error, "The property \"name\" is declared multiple times in this object. Remove or rename the duplicate properties."), + ("BCP025", DiagnosticLevel.Error, "The property \"name\" is declared multiple times in this object. Remove or rename the duplicate properties."), + }); + } + } + } +} \ No newline at end of file diff --git a/src/Bicep.Core/TypeSystem/DeployTimeConstantVisitor.cs b/src/Bicep.Core/TypeSystem/DeployTimeConstantVisitor.cs index 1c44778e52f..86b2255ed11 100644 --- a/src/Bicep.Core/TypeSystem/DeployTimeConstantVisitor.cs +++ b/src/Bicep.Core/TypeSystem/DeployTimeConstantVisitor.cs @@ -113,6 +113,12 @@ public override void VisitObjectSyntax(ObjectSyntax syntax) { return; } + + if (syntax.HasParseErrors()) + { + return; + } + // Only visit the object properties if they are required to be deploy time constant. foreach (var deployTimeIdentifier in ObjectSyntaxExtensions.ToNamedPropertyDictionary(syntax)) { From 47b5a5145873c6534c3501f3b5bf26349f305868 Mon Sep 17 00:00:00 2001 From: Anthony Martin Date: Mon, 8 Mar 2021 10:21:33 -0500 Subject: [PATCH 08/11] Fix baseline updater GH Action (#1772) * Fix baseline script * Break something * Use git config instead * Update test baselines Co-authored-by: Bicep Automation --- .github/workflows/update-baselines.yml | 4 + docs/examples/101/aks/main.json | 184 ++++++++++++------------- 2 files changed, 96 insertions(+), 92 deletions(-) diff --git a/.github/workflows/update-baselines.yml b/.github/workflows/update-baselines.yml index 2f5c952c9dd..af71c2ca8ec 100644 --- a/.github/workflows/update-baselines.yml +++ b/.github/workflows/update-baselines.yml @@ -31,7 +31,11 @@ jobs: - name: Commit baselines run: | + git config --global user.email "bicep@noreply.github.com" + git config --global user.name "Bicep Automation" + git add . + if ! git diff-index --quiet HEAD --; then git commit -m "Update test baselines" git push diff --git a/docs/examples/101/aks/main.json b/docs/examples/101/aks/main.json index b1c87419421..eba2678e7b9 100644 --- a/docs/examples/101/aks/main.json +++ b/docs/examples/101/aks/main.json @@ -1,93 +1,93 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "dnsPrefix": { - "type": "string" - }, - "linuxAdminUsername": { - "type": "string" - }, - "sshRSAPublicKey": { - "type": "string" - }, - "servicePrincipalClientId": { - "type": "string" - }, - "servicePrincipalClientSecret": { - "type": "secureString" - }, - "clusterName": { - "type": "string", - "defaultValue": "aks101cluster" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "osDiskSizeGB": { - "type": "int", - "defaultValue": 0, - "maxValue": 1023, - "minValue": 0 - }, - "agentCount": { - "type": "int", - "defaultValue": 3, - "maxValue": 50, - "minValue": 1 - }, - "agentVMSize": { - "type": "string", - "defaultValue": "Standard_DS2_v2" - } - }, - "functions": [], - "resources": [ - { - "type": "Microsoft.ContainerService/managedClusters", - "apiVersion": "2020-09-01", - "name": "[parameters('clusterName')]", - "location": "[parameters('location')]", - "properties": { - "dnsPrefix": "[parameters('dnsPrefix')]", - "agentPoolProfiles": [ - { - "name": "agentpool", - "osDiskSizeGB": "[parameters('osDiskSizeGB')]", - "count": "[parameters('agentCount')]", - "vmSize": "[parameters('agentVMSize')]", - "osType": "Linux" - } - ], - "linuxProfile": { - "adminUsername": "[parameters('linuxAdminUsername')]", - "ssh": { - "publicKeys": [ - { - "keyData": "[parameters('sshRSAPublicKey')]" - } - ] - } - }, - "servicePrincipalProfile": { - "clientId": "[parameters('servicePrincipalClientId')]", - "secret": "[parameters('servicePrincipalClientSecret')]" - } - } - } - ], - "outputs": { - "controlPlaneFQDN": { - "type": "string", - "value": "[reference(resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))).fqdn]" - } - }, - "metadata": { - "_generator": { - "name": "bicep", - "version": "dev", - "templateHash": "4675384475882014116" - } - } +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "dnsPrefix": { + "type": "string" + }, + "linuxAdminUsername": { + "type": "string" + }, + "sshRSAPublicKey": { + "type": "string" + }, + "servicePrincipalClientId": { + "type": "string" + }, + "servicePrincipalClientSecret": { + "type": "secureString" + }, + "clusterName": { + "type": "string", + "defaultValue": "aks101cluster" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "osDiskSizeGB": { + "type": "int", + "defaultValue": 0, + "maxValue": 1023, + "minValue": 0 + }, + "agentCount": { + "type": "int", + "defaultValue": 3, + "maxValue": 50, + "minValue": 1 + }, + "agentVMSize": { + "type": "string", + "defaultValue": "Standard_DS2_v2" + } + }, + "functions": [], + "resources": [ + { + "type": "Microsoft.ContainerService/managedClusters", + "apiVersion": "2020-09-01", + "name": "[parameters('clusterName')]", + "location": "[parameters('location')]", + "properties": { + "dnsPrefix": "[parameters('dnsPrefix')]", + "agentPoolProfiles": [ + { + "name": "agentpool", + "osDiskSizeGB": "[parameters('osDiskSizeGB')]", + "count": "[parameters('agentCount')]", + "vmSize": "[parameters('agentVMSize')]", + "osType": "Linux" + } + ], + "linuxProfile": { + "adminUsername": "[parameters('linuxAdminUsername')]", + "ssh": { + "publicKeys": [ + { + "keyData": "[parameters('sshRSAPublicKey')]" + } + ] + } + }, + "servicePrincipalProfile": { + "clientId": "[parameters('servicePrincipalClientId')]", + "secret": "[parameters('servicePrincipalClientSecret')]" + } + } + } + ], + "outputs": { + "controlPlaneFQDN": { + "type": "string", + "value": "[reference(resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))).fqdn]" + } + }, + "metadata": { + "_generator": { + "name": "bicep", + "version": "dev", + "templateHash": "4675384475882014116" + } + } } \ No newline at end of file From 490b029380b75fd8685635166e268b2a9140b8aa Mon Sep 17 00:00:00 2001 From: Gitte Vermeiren Date: Mon, 8 Mar 2021 16:53:13 +0100 Subject: [PATCH 09/11] Added example app-service-regional-vnet-integration (#1744) * added devcontainer for easier development (tools preinstalled) * added example app-service-regional-vnet-integration * updated example index * extra space * dev bicep version * removed devcontainer * simplified resource id * hash Co-authored-by: Gitte Vermeiren --- .../main.bicep | 61 ++++++++++++ .../main.json | 94 +++++++++++++++++++ docs/examples/index.json | 4 + 3 files changed, 159 insertions(+) create mode 100644 docs/examples/101/app-service-regional-vnet-integration/main.bicep create mode 100644 docs/examples/101/app-service-regional-vnet-integration/main.json diff --git a/docs/examples/101/app-service-regional-vnet-integration/main.bicep b/docs/examples/101/app-service-regional-vnet-integration/main.bicep new file mode 100644 index 00000000000..326834f72c0 --- /dev/null +++ b/docs/examples/101/app-service-regional-vnet-integration/main.bicep @@ -0,0 +1,61 @@ +param location string +param nameprefix string + +param vnetAddressPrefix string = '10.0.0.0/16' +param subnetAddressPrefix string = '10.0.0.0/24' + +resource appsvc 'Microsoft.Web/serverfarms@2020-06-01' = { + name: '${nameprefix}asp' + location: location + sku: { + name: 'S1' + } +} + +resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = { + name: '${nameprefix}vnet' + location: location + properties: { + addressSpace: { + addressPrefixes: [ + vnetAddressPrefix + ] + } + subnets: [ + { + name: '${nameprefix}sn' + properties: { + addressPrefix: subnetAddressPrefix + delegations: [ + { + name: 'delegation' + properties: { + serviceName: 'Microsoft.Web/serverFarms' + } + } + ] + } + } + ] + } +} + +resource webapp1 'Microsoft.Web/sites@2020-06-01' = { + name: '${nameprefix}wa' + location: location + kind: 'app' + dependsOn: [ + appsvc + vnet + ] + properties: { + serverFarmId: appsvc.id + } +} + +resource webapp1vnet 'Microsoft.Web/sites/networkConfig@2020-06-01' = { + name: '${webapp1.name}/virtualNetwork' + properties: { + subnetResourceId: vnet.properties.subnets[0].id + } +} diff --git a/docs/examples/101/app-service-regional-vnet-integration/main.json b/docs/examples/101/app-service-regional-vnet-integration/main.json new file mode 100644 index 00000000000..0b6113476ea --- /dev/null +++ b/docs/examples/101/app-service-regional-vnet-integration/main.json @@ -0,0 +1,94 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "location": { + "type": "string" + }, + "nameprefix": { + "type": "string" + }, + "vnetAddressPrefix": { + "type": "string", + "defaultValue": "10.0.0.0/16" + }, + "subnetAddressPrefix": { + "type": "string", + "defaultValue": "10.0.0.0/24" + } + }, + "functions": [], + "resources": [ + { + "type": "Microsoft.Web/serverfarms", + "apiVersion": "2020-06-01", + "name": "[format('{0}asp', parameters('nameprefix'))]", + "location": "[parameters('location')]", + "sku": { + "name": "S1" + } + }, + { + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-06-01", + "name": "[format('{0}vnet', parameters('nameprefix'))]", + "location": "[parameters('location')]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('vnetAddressPrefix')]" + ] + }, + "subnets": [ + { + "name": "[format('{0}sn', parameters('nameprefix'))]", + "properties": { + "addressPrefix": "[parameters('subnetAddressPrefix')]", + "delegations": [ + { + "name": "delegation", + "properties": { + "serviceName": "Microsoft.Web/serverFarms" + } + } + ] + } + } + ] + } + }, + { + "type": "Microsoft.Web/sites", + "apiVersion": "2020-06-01", + "name": "[format('{0}wa', parameters('nameprefix'))]", + "location": "[parameters('location')]", + "kind": "app", + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', format('{0}asp', parameters('nameprefix')))]" + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', format('{0}asp', parameters('nameprefix')))]", + "[resourceId('Microsoft.Network/virtualNetworks', format('{0}vnet', parameters('nameprefix')))]" + ] + }, + { + "type": "Microsoft.Web/sites/networkConfig", + "apiVersion": "2020-06-01", + "name": "[format('{0}/virtualNetwork', format('{0}wa', parameters('nameprefix')))]", + "properties": { + "subnetResourceId": "[reference(resourceId('Microsoft.Network/virtualNetworks', format('{0}vnet', parameters('nameprefix')))).subnets[0].id]" + }, + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks', format('{0}vnet', parameters('nameprefix')))]", + "[resourceId('Microsoft.Web/sites', format('{0}wa', parameters('nameprefix')))]" + ] + } + ], + "metadata": { + "_generator": { + "name": "bicep", + "version": "dev", + "templateHash": "12140943735656405647" + } + } +} \ No newline at end of file diff --git a/docs/examples/index.json b/docs/examples/index.json index ed0ca32d7ac..fdd1595386a 100644 --- a/docs/examples/index.json +++ b/docs/examples/index.json @@ -31,6 +31,10 @@ "filePath": "101/app-config/main.bicep", "description": "101/app-config" }, + { + "filePath": "101/app-service-regional-vnet-integration/main.bicep", + "description": "101/app-service-regional-vnet-integration" + }, { "filePath": "101/application-gateway-v2-autoscale-create/main.bicep", "description": "101/application-gateway-v2-autoscale-create" From 270678be702b4cd7c545da703b3320903c8ce86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20H=C3=BCpppauff?= Date: Mon, 8 Mar 2021 17:41:49 +0100 Subject: [PATCH 10/11] Fixed comments (#1775) --- docs/examples/101/web-app-windows/main.bicep | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/101/web-app-windows/main.bicep b/docs/examples/101/web-app-windows/main.bicep index 745577ff2b3..9727b0f58f7 100644 --- a/docs/examples/101/web-app-windows/main.bicep +++ b/docs/examples/101/web-app-windows/main.bicep @@ -7,7 +7,7 @@ var appServicePlanName = toLower('asp-${appName}') var webSiteName = toLower('wapp-${appName}') resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = { - name: appServicePlanName // Globally unique storage account name + name: appServicePlanName // app serivce plan name location: location // Azure Region sku: { name: skuName @@ -20,7 +20,7 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = { } resource appService 'Microsoft.Web/sites@2020-06-01' = { - name: webSiteName + name: webSiteName // Globally unique app serivce name location: location identity: { type: 'SystemAssigned' From 30cb620d870004648be5570eb9c022560ceaf5a4 Mon Sep 17 00:00:00 2001 From: Anthony Martin Date: Mon, 8 Mar 2021 13:55:08 -0500 Subject: [PATCH 11/11] Correct codegen for module name reference (#1733) * Correct codegen for module name reference * Update baselines --- .../ScenarioTests.cs | 48 +++++++++++++++++++ .../Files/Loops_LF/main.json | 4 +- .../Files/Modules_CRLF/main.json | 16 +++---- src/Bicep.Core/Emit/ExpressionConverter.cs | 44 +++++++++++++++-- 4 files changed, 97 insertions(+), 15 deletions(-) diff --git a/src/Bicep.Core.IntegrationTests/ScenarioTests.cs b/src/Bicep.Core.IntegrationTests/ScenarioTests.cs index de67d79d066..121c279b292 100644 --- a/src/Bicep.Core.IntegrationTests/ScenarioTests.cs +++ b/src/Bicep.Core.IntegrationTests/ScenarioTests.cs @@ -890,6 +890,54 @@ param stampLocations array { diags.Should().ContainDiagnostic("BCP052", DiagnosticLevel.Error, "The type \"outputs\" does not contain property \"cosmosDbKey\"."); } + [TestMethod] + public void Test_Issue1592() + { + var (template, diags, _) = CompilationHelper.Compile( + ("main.bicep", @" +module foo 'test.bicep' = { + name: 'foo' +} + +output fooName string = foo.name + "), + ("test.bicep", @"")); + + diags.Should().BeEmpty(); + template!.Should().NotBeNull(); + using (new AssertionScope()) + { + template!.SelectToken("$.outputs['fooName'].value")!.Should().DeepEqual("foo"); + } + } + + [TestMethod] + public void Test_Issue1592_special_cases() + { + var (template, diags, _) = CompilationHelper.Compile( + ("main.bicep", @" +param someParam string + +module foo 'test.bicep' = { + name: '${someParam}-test' +} + +output fooName string = foo.name +output fooOutput string = foo.outputs.test + "), + ("test.bicep", @" +output test string = 'hello' +")); + + diags.Should().BeEmpty(); + template!.Should().NotBeNull(); + using (new AssertionScope()) + { + template!.SelectToken("$.outputs['fooName'].value")!.Should().DeepEqual("[format('{0}-test', parameters('someParam'))]"); + template!.SelectToken("$.outputs['fooOutput'].value")!.Should().DeepEqual("[reference(resourceId('Microsoft.Resources/deployments', format('{0}-test', parameters('someParam'))), '2019-10-01').outputs.test.value]"); + } + } + [TestMethod] public void Test_Issue1432() { diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/main.json b/src/Bicep.Core.Samples/Files/Loops_LF/main.json index 6b58a8364ce..6bccda89992 100644 --- a/src/Bicep.Core.Samples/Files/Loops_LF/main.json +++ b/src/Bicep.Core.Samples/Files/Loops_LF/main.json @@ -666,7 +666,7 @@ }, "indexedModulesName": { "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', variables('moduleSetup')[parameters('index')]), '2019-10-01').outputs.name]" + "value": "[variables('moduleSetup')[parameters('index')]]" }, "indexedModuleOutput": { "type": "string", @@ -701,7 +701,7 @@ "_generator": { "name": "bicep", "version": "dev", - "templateHash": "29057223099977573" + "templateHash": "15563763134771957148" } } } \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.json b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.json index 2bee5d3b718..548b87082f4 100644 --- a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.json +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.json @@ -41,12 +41,12 @@ { "type": "Mock.Rp/mockResource", "apiVersion": "2020-01-01", - "name": "[format('{0}{1}', reference(resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency'), '2019-10-01').outputs.name, parameters('deployTimeSuffix'))]", + "name": "[format('{0}{1}', 'optionalWithAllParamsAndManualDependency', parameters('deployTimeSuffix'))]", "properties": { - "modADep": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}{1}', reference(resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency'), '2019-10-01').outputs.name, parameters('deployTimeSuffix'))), '2019-10-01').outputs.outputObj.value]" + "modADep": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}{1}', 'optionalWithAllParamsAndManualDependency', parameters('deployTimeSuffix'))), '2019-10-01').outputs.outputObj.value]" }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', format('{0}{1}', reference(resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency'), '2019-10-01').outputs.name, parameters('deployTimeSuffix')))]", + "[resourceId('Microsoft.Resources/deployments', format('{0}{1}', 'optionalWithAllParamsAndManualDependency', parameters('deployTimeSuffix')))]", "[resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency')]" ] }, @@ -467,7 +467,7 @@ "mode": "Incremental", "parameters": { "optionalString": { - "value": "[concat(resourceId('Mock.Rp/mockResource', 'harry'), reference(resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency'), '2019-10-01').outputs.name)]" + "value": "[concat(resourceId('Mock.Rp/mockResource', 'harry'), 'optionalWithAllParamsAndManualDependency')]" }, "optionalInt": { "value": 42 @@ -529,7 +529,7 @@ { "type": "Microsoft.Resources/deployments", "apiVersion": "2019-10-01", - "name": "[format('{0}{1}', reference(resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency'), '2019-10-01').outputs.name, parameters('deployTimeSuffix'))]", + "name": "[format('{0}{1}', 'optionalWithAllParamsAndManualDependency', parameters('deployTimeSuffix'))]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -537,7 +537,7 @@ "mode": "Incremental", "parameters": { "optionalString": { - "value": "[concat(resourceId('Mock.Rp/mockResource', 'harry'), reference(resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency'), '2019-10-01').outputs.name)]" + "value": "[concat(resourceId('Mock.Rp/mockResource', 'harry'), 'optionalWithAllParamsAndManualDependency')]" }, "optionalInt": { "value": 42 @@ -1287,14 +1287,14 @@ }, "modCalculatedNameOutput": { "type": "object", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}{1}', reference(resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency'), '2019-10-01').outputs.name, parameters('deployTimeSuffix'))), '2019-10-01').outputs.outputObj.value]" + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}{1}', 'optionalWithAllParamsAndManualDependency', parameters('deployTimeSuffix'))), '2019-10-01').outputs.outputObj.value]" } }, "metadata": { "_generator": { "name": "bicep", "version": "dev", - "templateHash": "5916075395955971227" + "templateHash": "16918224688153038135" } } } \ No newline at end of file diff --git a/src/Bicep.Core/Emit/ExpressionConverter.cs b/src/Bicep.Core/Emit/ExpressionConverter.cs index f007dd01b73..55f4e662cda 100644 --- a/src/Bicep.Core/Emit/ExpressionConverter.cs +++ b/src/Bicep.Core/Emit/ExpressionConverter.cs @@ -210,6 +210,20 @@ private LanguageExpression ConvertPropertyAccess(PropertyAccessSyntax propertyAc return null; } + LanguageExpression? ConvertModulePropertyAccess(ModuleSymbol moduleSymbol, SyntaxBase? indexExpression) + { + switch (propertyAccess.PropertyName.IdentifierName) + { + case "name": + // the name is dependent on the name expression which could involve locals in case of a resource collection + return this + .CreateConverterForIndexReplacement(GetModuleNameSyntax(moduleSymbol), indexExpression, propertyAccess) + .GetModuleNameExpression(moduleSymbol); + } + + return null; + } + if ((propertyAccess.BaseExpression is VariableAccessSyntax || propertyAccess.BaseExpression is ResourceAccessSyntax) && context.SemanticModel.GetSymbolInfo(propertyAccess.BaseExpression) is ResourceSymbol resourceSymbol && ConvertResourcePropertyAccess(resourceSymbol, indexExpression: null) is { } convertedSingle) @@ -230,15 +244,35 @@ private LanguageExpression ConvertPropertyAccess(PropertyAccessSyntax propertyAc return convertedCollection; } + if (propertyAccess.BaseExpression is VariableAccessSyntax modulePropVariableAccess && + context.SemanticModel.GetSymbolInfo(modulePropVariableAccess) is ModuleSymbol moduleSymbol && + ConvertModulePropertyAccess(moduleSymbol, indexExpression: null) is { } moduleConvertedSingle) + { + // we are doing property access on a single module + // and we are dealing with special case properties + return moduleConvertedSingle; + } + + if (propertyAccess.BaseExpression is ArrayAccessSyntax modulePropArrayAccess && + modulePropArrayAccess.BaseExpression is VariableAccessSyntax moduleArrayVariableAccess && + context.SemanticModel.GetSymbolInfo(moduleArrayVariableAccess) is ModuleSymbol moduleCollectionSymbol && + ConvertModulePropertyAccess(moduleCollectionSymbol, modulePropArrayAccess.IndexExpression) is { } moduleConvertedCollection) + { + + // we are doing property access on an array access of a module collection + // and we are dealing with special case properties + return moduleConvertedCollection; + } + // is this a (.outputs). propertyAccess? if (propertyAccess.BaseExpression is PropertyAccessSyntax childPropertyAccess && childPropertyAccess.PropertyName.IdentifierName == LanguageConstants.ModuleOutputsPropertyName) { // is a variable which points to a non-collection module symbol? if (childPropertyAccess.BaseExpression is VariableAccessSyntax grandChildVariableAccess && - context.SemanticModel.GetSymbolInfo(grandChildVariableAccess) is ModuleSymbol { IsCollection: false } moduleSymbol) + context.SemanticModel.GetSymbolInfo(grandChildVariableAccess) is ModuleSymbol { IsCollection: false } outputsModuleSymbol) { return AppendProperties( - this.GetModuleOutputsReferenceExpression(moduleSymbol), + this.GetModuleOutputsReferenceExpression(outputsModuleSymbol), new JTokenExpression(propertyAccess.PropertyName.IdentifierName), new JTokenExpression("value")); } @@ -246,11 +280,11 @@ private LanguageExpression ConvertPropertyAccess(PropertyAccessSyntax propertyAc // is an array access operating on a module collection if (childPropertyAccess.BaseExpression is ArrayAccessSyntax grandChildArrayAccess && grandChildArrayAccess.BaseExpression is VariableAccessSyntax grandGrandChildVariableAccess && - context.SemanticModel.GetSymbolInfo(grandGrandChildVariableAccess) is ModuleSymbol { IsCollection: true } moduleCollectionSymbol) + context.SemanticModel.GetSymbolInfo(grandGrandChildVariableAccess) is ModuleSymbol { IsCollection: true } outputsModuleCollectionSymbol) { - var updatedConverter = this.CreateConverterForIndexReplacement(GetModuleNameSyntax(moduleCollectionSymbol), grandChildArrayAccess.IndexExpression, propertyAccess); + var updatedConverter = this.CreateConverterForIndexReplacement(GetModuleNameSyntax(outputsModuleCollectionSymbol), grandChildArrayAccess.IndexExpression, propertyAccess); return AppendProperties( - updatedConverter.GetModuleOutputsReferenceExpression(moduleCollectionSymbol), + updatedConverter.GetModuleOutputsReferenceExpression(outputsModuleCollectionSymbol), new JTokenExpression(propertyAccess.PropertyName.IdentifierName), new JTokenExpression("value")); }