An experimental TypeSpec syntax for Lexicon

Fix #2

Changed files
+12
packages
emitter
+12
packages/emitter/src/emitter.ts
··· 947 947 const properties: Record<string, LexObjectProperty> = {}; 948 948 949 949 for (const [name, prop] of model.properties) { 950 + // Check for conflicting @required on optional property 951 + if (prop.optional && isRequired(this.program, prop)) { 952 + this.program.reportDiagnostic({ 953 + code: "required-on-optional", 954 + message: 955 + `Property "${name}" has conflicting markers: @required decorator with optional "?". ` + 956 + `Either remove @required to make it optional (preferred), or remove the "?".`, 957 + target: prop, 958 + severity: "error", 959 + }); 960 + } 961 + 950 962 if (!prop.optional) { 951 963 if (!isRequired(this.program, prop)) { 952 964 this.program.reportDiagnostic({