TypeScript/tests/cases/compiler/decoratorReferenceOnOtherProperty.ts
Wesley Wigham a1014b2b13
Mark all parameters as needed for metadata when one is decorated (#19849)
* Mark all properties as needed for metadata when one is decorated

* Add restarg test
2017-11-09 00:26:33 -08:00

25 lines
518 B
TypeScript

// https://github.com/Microsoft/TypeScript/issues/19799
// @experimentalDecorators: true
// @emitDecoratorMetadata: true
// @filename: yoha.ts
export class Yoha {}
// @filename: index.ts
import {Yoha} from './yoha';
function foo(...args: any[]) {}
class Bar {
yoha(@foo yoha, bar: Yoha) {}
// ^^^^
}
// @filename: index2.ts
import {Yoha} from './yoha';
function foo(...args: any[]) {}
class Bar {
yoha(@foo yoha, ...bar: Yoha[]) {}
// ^^^^
}