Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use imported symbol identifiers rather than identity in memory to deduplicate imports when building closure #14615

Merged
merged 5 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/Bicep.Core.IntegrationTests/CompileTimeImportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2362,4 +2362,38 @@ public void Bicepparam_can_import_non_literal_variables_from_json()
result.Parameters.Should().NotBeNull();
result.Parameters.Should().HaveValueAtPath("parameters.aParam.value", 4);
}

[TestMethod]
public void Symbols_entering_the_import_closure_via_multiple_paths_are_supported()
{
var result = CompilationHelper.Compile(
("main.bicep", """
import * as typesB from 'moduleB.bicep'
import * as typesC from 'moduleC.bicep'
"""),
("moduleA.bicep", """
@export()
type typeA = {
propA: string
}
"""),
("moduleB.bicep", """
import * as typesA from 'moduleA.bicep'
@export()
type typeB = {
optionsA: typesA.typeA
propB: string
}
"""),
("moduleC.bicep", """
import * as typesA from 'moduleA.bicep'
@export()
type typeC = {
optionsA: typesA.typeA
propC: string
}
"""));

result.ExcludingLinterDiagnostics().Should().NotHaveAnyDiagnostics();
}
}
Loading
Loading