Skip to content

Handle case insensitive name clashes for imported variable, func, and type symbols - #17200

Merged
Levi Muriuki (levimatheri) merged 1 commit into
mainfrom
levi/name-clash-case-sensitivity
May 22, 2025
Merged

Levi Muriuki (levimatheri) merged 1 commit into
mainfrom
levi/name-clash-case-sensitivity

Conversation

@levimatheri

@levimatheri Levi Muriuki (levimatheri) commented May 22, 2025 •

Copy link
Copy Markdown
Member

Closes #17192.

Description

Handle case insensitive name clashes for imported variable, func, and type symbols.

Example Usage

exports:
image

main.bicep:
image

diagnostics on main.bicep:
image

Checklist

Microsoft Reviewers: Open in CodeFlow

@github-actions

github-actions Bot commented May 22, 2025 •

Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 15190097668)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 15190097668
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 15190097668"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 15190097668
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 15190097668"

@github-actions

Copy link
Copy Markdown
Contributor

Dotnet Test Results

    78 files   -     39      78 suites   - 39   35m 59s ⏱️ - 19m 15s
12 155 tests  -     12  12 155 ✅  -     12  0 💤 ±0  0 ❌ ±0 
28 072 runs   - 14 028  28 072 ✅  - 14 028  0 💤 ±0  0 ❌ ±0 

Results for commit 2aa9d5d. ± Comparison against base commit f0d6dac.

This pull request removes 1897 and adds 642 tests. Note that renamed tests count towards both.

		nestedProp1: 1
		nestedProp2: 2
		prop1: true
		prop2: false
	1
	2
	\$'")
	prop1: true
	prop2: false
…
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��K
�0\u0010\u0006�=EO�Ο&\u001d]t��+\u0004-����\u0005��\u000b�E���
�[f\u00182y�2��n��C^Ւ)ձ\u0014S#/�zp�\u0007\u0003\u0001~!Al�\u0012"�&�d@[7��̱�\u000fR��6�"���7�0J& f`�k��\u001a��m�Y�.��9y�K�7\u0014c
K\u001f4\u0018��~ߺ�O�'R\u0002��\u0018�QT��(��ϒ�?�����\u0004A\u0010\u0004�\u0012�X���\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
���
�0\u000c\u0007�}��\u0007�I�.N��E��\u0003T\u0017QqS�	\u0003�ݝ\u0007���2?���M�i��\u000c羙�Ϥ�\u000cCBC��\u0006�����
\u0012+�;P�αR��}�'NU��v�O����H�z��\u0004�8\u0005��\u001a�d	�A[[u�0�G_o&�"���Cqkϻڿ�̠���޷�W���\u0014:��1bl\u0015$����G2���?�hQHs�U-�L��X����˷g\u000b� \u0008��
B8�\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
���\u000b�0\u0014\u0007��+�?`��͗���CFX\u0010t��B\u0006Z���?�<D\u0017��?��9�=���w�٫z��8)J��\u0013\u000e%}c�'D�z\u0003\u0004\u0012�7F\u0018J��Xux��*�(c�����RU�%\u0001�@�!HN]�\u0003������j�[wU]�4���^�[޴g]�S\u001f���y���[�\u0019\u0017\u0004$\u0003W"\u0000����+u�G����i��q�
W��a\u0017�\u000bK��S�d\u0018�a\u000c�\u0005v�5�\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003�ӽ
�0\u0010\u0007��>E�\u0003�K�4���Ep�\u0001b{b���F(��n:�K�K?\u0004�\u001bs\u0007w����^�[�\u0019�
\u0015\�5��\u0006V\u0018\u0004��\u001dfkL��\u0007Jvݤ\u001d}�\u001e���ڮ2Ǭ\u001f�\u0015�&/0a*P1(�\u0005
��(Z�R:Pb1��9'y�aK/ͭ캋����\u000c�\p�\u0019��\u000f��_\u0002\u0013R1�҃P\u0006����L�y�\u001f�?��V�\u001a�vX\u001c��7䤯
>���q\u001cǙ�\u000b�y\u0014�\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003�ӽ
�0\u0010\u0007��}�<A�ˇ��{ǾBh�~`,\u001a�P��C����j��
\u0019r\u001cw!�E�������i��
\u0013��\u0006A����\u0000
2�\u0017`@FK�x?�&#���&��Ĭ\u001f$3n��*\u000b$M9\u0010�J\u0018I��h\u0013j��\u001a��Ǣs\u0017Wߜ8��\u001b\u001a����\u001f\u001a�z��o����\u0000��\u0000*C\u0008҄�c8\u0019_$�����c�
�(��5<\u0001�\u001eCY\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003��Q\u000b�0\u0010\u0000�=�+�\u001f0�ts\u001a�\u0010��\u0011\u0016\u0004���A\u0006Z��Пo>D/J/jA�\u001e�\u000e��v��N6+%SUV�s=t(\u0019\u001ah>c��\u00162AP�\u0000\u0001�u�X���t�W�,�(S��An`�:�U���\u0010\u0004�\u001e�~�\u001fB0ӹS_\u000eC�&�s�\u0015�j襺\u0016my�W��c\u001a=��7^�O�\u000f.#�\u0001=.\u0010\N��\u000c��O�����\u000f;N\u000e�M�<���Ğ[�\u0007��L�a\u0018���\�Ĝ\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.DirectResourceCollectionTests ‑ DirectResourceCollectionAccess_NotAllowedWithinLoops ("output loopOutput array = [for i in range(0, 2): {
  prop: map(containerWorkers, (w) => w.properties.ipAddress.ip)
}]")
Bicep.Core.IntegrationTests.DirectResourceCollectionTests ‑ DirectResourceCollectionAccess_NotAllowedWithinLoops ("resource propertyLoop 'Microsoft.ContainerInstance/containerGroups@2022-09-01' = {
  name: 'gh9440-loop'
  location: 'westus'
  properties: {
    containers: [for i in range(0, 2): {
      name: 'gh9440-w1c-${i}'
      properties: {
        command: [
          'echo "${join(map(containerWorkers, (w) => w.properties.ipAddress.ip), ',')}"'
        ]
      }
    }]
  }
}")
Bicep.Core.IntegrationTests.DirectResourceCollectionTests ‑ DirectResourceCollectionAccess_NotAllowedWithinLoops ("var loopVar = [for i in range(0, 2): {
  prop: map(containerWorkers, (w) => w.properties.ipAddress.ip)
}]")
Bicep.Core.IntegrationTests.Emit.ParamsFileWriterTests ‑ Params_file_with_no_errors_should_compile_correctly ("
using 'main.bicep'

// involves all syntax
param myParam = {
  arr: [
    {
      a : 'b'
    }
    {
      c : true
    }
  ]
  name: 'complex object!'
  priority: 3
  val: null
  obj: {
      a: 'b'
      c: [
          'd'
           1
      ]
  }
}","
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "myParam": {
      "value": {
        "arr" : [
          {
            "a" : "b"
          },
          {
            "c" : true
          }
        ],
        "name" : "complex object!",
        "priority" : 3,
        "val" : null,
        "obj" : {
          "a" : "b",
          "c" : [
            "d",
            1
          ]
        }
      }
    }
  }
}","
param myParam object
")
…

@levimatheri
Levi Muriuki (levimatheri) deleted the levi/name-clash-case-sensitivity branch May 22, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Variable collision silently fails during build

2 participants