diff --git a/packages/compiler/CHANGELOG.md b/packages/compiler/CHANGELOG.md index a1b2258bda..a8f0e76cc3 100644 --- a/packages/compiler/CHANGELOG.md +++ b/packages/compiler/CHANGELOG.md @@ -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 diff --git a/packages/compiler/package.json b/packages/compiler/package.json index 6e1261c241..5f4ffa1899 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/compiler", - "version": "0.65.1", + "version": "0.65.2", "description": "TypeSpec Compiler Preview", "author": "Microsoft Corporation", "license": "MIT", diff --git a/packages/compiler/src/lib/decorators.ts b/packages/compiler/src/lib/decorators.ts index 4cdb26e1ff..42639c9686 100644 --- a/packages/compiler/src/lib/decorators.ts +++ b/packages/compiler/src/lib/decorators.ts @@ -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"; @@ -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, diff --git a/packages/compiler/templates/scaffolding.json b/packages/compiler/templates/scaffolding.json index 1cead52361..74957a99dd 100644 --- a/packages/compiler/templates/scaffolding.json +++ b/packages/compiler/templates/scaffolding.json @@ -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", @@ -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": [ { @@ -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": [ {