diff --git a/packages/jsii/lib/assembler.ts b/packages/jsii/lib/assembler.ts index be5052fc42..913c28919b 100644 --- a/packages/jsii/lib/assembler.ts +++ b/packages/jsii/lib/assembler.ts @@ -1018,7 +1018,7 @@ export class Assembler implements Emitter { private _warnAboutReservedWords(symbol: ts.Symbol) { const reservingLanguages = isReservedName(symbol.name); if (reservingLanguages) { - this._diagnostic(symbol.valueDeclaration, + this._diagnostic(ts.getNameOfDeclaration(symbol.valueDeclaration) || symbol.valueDeclaration, ts.DiagnosticCategory.Warning, `'${symbol.name}' is a reserved word in ${reservingLanguages.join(', ')}. Using this name may cause problems ` + 'when generating language bindings. Consider using a different name.');