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

Back merge 0.65.2 compiler hotfix #6019

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log - @typespec/compiler

## 0.65.2

### Bug Fixes

- [#6003](https://github.com/microsoft/typespec/pull/6003) Fix regression where enum values would report not being assignable to their enum when using versioning


## 0.65.1

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typespec/compiler",
"version": "0.65.1",
"version": "0.65.2",
"description": "TypeSpec Compiler Preview",
"author": "Microsoft Corporation",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/compiler/src/lib/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import {
UnionVariant,
Value,
} from "../core/types.js";
import { Realm } from "../experimental/realm.js";
import { useStateMap, useStateSet } from "../utils/index.js";
import { setKey } from "./key.js";
import { createStateSymbol, filterModelPropertiesInPlace } from "./utils.js";
Expand Down Expand Up @@ -1300,7 +1301,7 @@ export const $example: ExampleDecorator = (
compilerAssert(decorator, `Couldn't find @example decorator`, context.decoratorTarget);
const rawExample = decorator.args[0].value as Value;
// skip validation in projections
if (target.projectionBase === undefined) {
if (target.projectionBase === undefined && Realm.realmForType.get(target) === undefined) {
if (
!checkExampleValid(
context.program,
Expand Down
8 changes: 4 additions & 4 deletions packages/compiler/templates/scaffolding.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"title": "Empty project",
"description": "Create an empty project.",
"libraries": [],
"compilerVersion": "0.65.1"
"compilerVersion": "0.65.2"
},
"rest": {
"title": "Generic REST API",
"description": "Create a project representing a generic REST API",
"compilerVersion": "0.65.1",
"compilerVersion": "0.65.2",
"libraries": [
"@typespec/http",
"@typespec/rest",
Expand Down Expand Up @@ -69,7 +69,7 @@
"library-ts": {
"title": "TypeSpec Library (With TypeScript)",
"description": "Create a new package to add decorators or linters to typespec.",
"compilerVersion": "0.65.1",
"compilerVersion": "0.65.2",
"libraries": [],
"files": [
{
Expand Down Expand Up @@ -145,7 +145,7 @@
"emitter-ts": {
"title": "TypeSpec Emitter (With TypeScript)",
"description": "Create a new package that will be emitting typespec",
"compilerVersion": "0.65.1",
"compilerVersion": "0.65.2",
"libraries": [],
"files": [
{
Expand Down
Loading