Skip to content

Commit f87ea4c

Browse files
committed
Don't throw on hash range when getNestedFields is false
1 parent 2b12135 commit f87ea4c

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

lib/parse/ParameterResolver.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ export class ParameterResolver {
189189
getNestedFields,
190190
);
191191
case 'hash':
192-
if (!getNestedFields) {
193-
throw new Error(`Unsupported field type ${range.type} when nested fields are not allowed in ${owningClass.localName} in ${owningClass.fileName}`);
194-
}
195192
return {
196193
type: 'nested',
197194
value: await this.getNestedFieldsFromHash(range.value, owningClass, genericTypeRemappings),

test/parse/ParameterResolver.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -552,17 +552,6 @@ describe('ParameterResolver', () => {
552552
});
553553
});
554554

555-
it('should throw on a hash range when getNestedFields is false', async() => {
556-
await expect(loader.resolveRange({
557-
type: 'hash',
558-
value: <any> {
559-
type: AST_NODE_TYPES.TSTypeLiteral,
560-
members: [],
561-
},
562-
}, classReference, {}, false)).rejects
563-
.toThrow(`Unsupported field type hash when nested fields are not allowed in A in A`);
564-
});
565-
566555
it('should handle an interface range pointing to a class', async() => {
567556
resolutionContext.contentsOverrides = {
568557
'A.d.ts': `export * from './MyClass'`,

0 commit comments

Comments
 (0)