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

Add a resource<'type@version'> utility type #12591

Merged
merged 26 commits into from
Jan 5, 2024
Merged

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented Nov 30, 2023

Partially address #9229

This PR adds a new ambient type symbol name resource (in the sys namespace) and kind of syntax for using types that accept parameters (resource<'type@version'>). This new kind of syntax is called a ParameterizedTypeInstantiation node because, following C#'s example, each appearance of the syntax is expected to produce a type symbol and an IR expression that can be used in place of a concrete type clause.

This PR does not implement the logic to use the type of a specific property within a resource body, as that is turning out to be fairly complex, and this PR is already large and pretty dense.

Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

github-actions bot commented Nov 30, 2023

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

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

Copy link
Contributor

github-actions bot commented Nov 30, 2023

Test Results

    74 files   -    25      74 suites   - 25   26m 34s ⏱️ - 21m 8s
10 591 tests +  104  10 590 ✅ +  103  0 💤 ±0  1 ❌ +1 
28 544 runs   - 9 613  28 543 ✅  - 9 614  0 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit d4b213e. ± Comparison against base commit 86e8f18.

♻️ This comment has been updated with latest results.

@jeskew jeskew marked this pull request as ready for review December 15, 2023 21:23
@jeskew jeskew requested a review from a team December 15, 2023 21:23
@jeskew jeskew force-pushed the jeskew/resource-utility-type branch from fe4e37c to b3fc5c7 Compare January 4, 2024 15:47
Copy link
Member

@anthony-c-martin anthony-c-martin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jeskew jeskew merged commit bc613cb into main Jan 5, 2024
43 of 44 checks passed
@jeskew jeskew deleted the jeskew/resource-utility-type branch January 5, 2024 23:33
jeskew added a commit that referenced this pull request Feb 1, 2024
…3163)

Added documentation for the "resource derived types" experimental
feature that was added by #12591
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants