tangled
alpha
login
or
join now
danabra.mov
/
typelex
56
fork
atom
An experimental TypeSpec syntax for Lexicon
56
fork
atom
overview
issues
1
pulls
2
pipelines
Fix #2
danabra.mov
5 months ago
2444e063
267190ed
+12
1 changed file
expand all
collapse all
unified
split
packages
emitter
src
emitter.ts
+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
950
+
// Check for conflicting @required on optional property
951
951
+
if (prop.optional && isRequired(this.program, prop)) {
952
952
+
this.program.reportDiagnostic({
953
953
+
code: "required-on-optional",
954
954
+
message:
955
955
+
`Property "${name}" has conflicting markers: @required decorator with optional "?". ` +
956
956
+
`Either remove @required to make it optional (preferred), or remove the "?".`,
957
957
+
target: prop,
958
958
+
severity: "error",
959
959
+
});
960
960
+
}
961
961
+
950
962
if (!prop.optional) {
951
963
if (!isRequired(this.program, prop)) {
952
964
this.program.reportDiagnostic({