File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
packages/emitter-typescript/src Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @typespec-tools/emitter-typescript " : minor
3
+ ---
4
+
5
+ fallback to use any when type is unknown
Original file line number Diff line number Diff line change @@ -177,7 +177,8 @@ export class TypescriptEmitter<
177
177
code `export type ${ scalarName } = ${ this . emitter . emitTypeReference ( scalar . baseScalar ) } `
178
178
) ;
179
179
} else if ( ! intrinsicNameToTSType . has ( scalarName ) ) {
180
- throw new Error ( "Unknown scalar type " + scalarName ) ;
180
+ // TODO: Add a warning here
181
+ return this . emitter . result . rawCode ( "any" ) ;
181
182
}
182
183
183
184
const typeCode = intrinsicNameToTSType . get ( scalarName ) ! ;
@@ -186,7 +187,8 @@ export class TypescriptEmitter<
186
187
187
188
intrinsic ( intrinsic : IntrinsicType , name : string ) : EmitterOutput < string > {
188
189
if ( ! intrinsicNameToTSType . has ( name ) ) {
189
- throw new Error ( "Unknown intrinsic type " + name ) ;
190
+ // TODO: Add a warning here
191
+ return this . emitter . result . rawCode ( "any" ) ;
190
192
}
191
193
192
194
const code = intrinsicNameToTSType . get ( name ) ! ;
You can’t perform that action at this time.
0 commit comments