Skip to content

Commit

Permalink
Add new const keyword breaking note (#3584)
Browse files Browse the repository at this point in the history
fix #3583
  • Loading branch information
timotheeguerin committed Jun 14, 2024
1 parent d7ec3da commit d319e33
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
17 changes: 16 additions & 1 deletion docs/release-notes/release-2024-06-10.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 0.57 - June 2024
---

:::warning
This release contains deprecations
This release contains deprecations and breaking changes
:::

## Values In TypeSpec
Expand Down Expand Up @@ -51,6 +51,21 @@ const ip: ipV4 = ipV4.fromInt(3232235776);

[See values doc for more info](https://typespec.io/docs/language-basics/values)

## Breaking changes

- [#3022](https://github.com/microsoft/typespec/pull/3022) Addition of new `const` keyword means using `const` as a property name or decorator name will result in an error. This can be fixed by wrapping the property in backtick.

```tsp
model Test {
// error
const: string;
// correct
`const`: string;
}
```

## Deprecations

### @typespec/compiler
Expand Down
16 changes: 16 additions & 0 deletions packages/compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

## 0.57.0


### Breaking changes

- [#3022](https://github.com/microsoft/typespec/pull/3022) Addition of new `const` keyword means using `const` as a property name or decorator name will result in an error. This can be fixed by wrapping the property in backtick.

```tsp
model Test {
// error
const: string;
// correct
`const`: string;
}
```

### Bug Fixes

- [#3399](https://github.com/microsoft/typespec/pull/3399) Preserve leading whitespace in fenced blocks in doc comments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 0.57 - June 2024
---

:::warning
This release contains deprecations
This release contains deprecations and breaking changes
:::

## Values In TypeSpec
Expand Down Expand Up @@ -51,6 +51,21 @@ const ip: ipV4 = ipV4.fromInt(3232235776);

[See values doc for more info](https://typespec.io/docs/language-basics/values)

## Breaking changes

- [#3022](https://github.com/microsoft/typespec/pull/3022) Addition of new `const` keyword means using `const` as a property name or decorator name will result in an error. This can be fixed by wrapping the property in backtick.

```tsp
model Test {
// error
const: string;
// correct
`const`: string;
}
```

## Deprecations

### @typespec/compiler
Expand Down

0 comments on commit d319e33

Please sign in to comment.