Azure / Azure/bicep

Use structural names for object literals

Open
#12,038 0 comments 0 reactions 0 assignees View on GitHub
enhancement type system
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 2h
Merged PRs (30d)
79

Description

**Is your feature request related to a problem? Please describe.**
Inferred types assigned to object literal expressions are always named `object`, which doesn't tell users anything about the content of the value when the type name is included in a hover tooltip.

**Describe the solution you'd like**
Objects should be given structural names (similar to how user-defined object types are named). For example, the type assigned to `foo` in the following snippet should be named `{ bar: 'bar', baz: 'baz' }` instead of `object`:

```bicep
var foo = {
bar: 'bar'
baz: 'baz'
}
```

Contributor guide

Open the contributing guide

Research direction

The issue names no file, test, or entry point. Trace object-literal type inference in the Bicep compiler and inspect the hover-tooltip behavior; done means the example reports `{ bar: 'bar', baz: 'baz' }` rather than `object`.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.