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

Output type inference #10421

Closed
wants to merge 7 commits into from
Closed

Output type inference #10421

wants to merge 7 commits into from

Conversation

jeskew
Copy link
Member

@jeskew jeskew commented Apr 13, 2023

Addresses an ask from #10354

As a companion to #10418, this PR updates output type inference to take the supplied output value into account.

One potential drawback of inferring more detailed type information from the value is that while Bicep can easily figure out an extremely narrow type for a statement written in Bicep, the compiler isn't as smart when looking at JSON templates. E.g., the type of foo would be 'foo' in output foo string = 'foo' and would just be string in:

{
  ...
  "outputs": {
    "foo": {
      "type": "string",
      "value": "foo"
    }
  }
}

The above limitation would mean that type inference would work for a local bicep module but not one that had been published to the registry.

Microsoft Reviewers: Open in CodeFlow

@jeskew jeskew force-pushed the jeskew/output-type-inference branch from 2f022a4 to 87338be Compare April 13, 2023 21:41
@jeskew jeskew added the discussion This is a discussion issue and not a change proposal. label Apr 13, 2023
@jeskew jeskew removed the discussion This is a discussion issue and not a change proposal. label May 4, 2023
@jeskew jeskew marked this pull request as draft May 4, 2023 00:05
@jeskew
Copy link
Member Author

jeskew commented May 4, 2023

Per a team discussion, publishing a Bicep module to a registry should not be a lossy proposition. Inferred type information would need to be persisted in the compiled JSON template.

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.

1 participant