Skip to content

Commit

Permalink
Use imported symbol identifiers rather than representation in memory …
Browse files Browse the repository at this point in the history
…as dictionary key in ImportClosure representation.
  • Loading branch information
jeskew committed Jul 21, 2024
1 parent 684e6d4 commit 752ff3d
Show file tree
Hide file tree
Showing 5 changed files with 448 additions and 147 deletions.
34 changes: 34 additions & 0 deletions src/Bicep.Core.IntegrationTests/CompileTimeImportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2361,4 +2361,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

0 comments on commit 752ff3d

Please sign in to comment.