//// [tests/cases/compiler/decoratorReferences.ts] ////

//// [decoratorReferences.ts]
declare function y(...args: any[]): any;
type T = number;
@y(1 as T, () => C) // <-- T should be resolved to the type alias, not the type parameter of the class; C should resolve to the class
class C<T> {
    @y(null as T) // <-- y should resolve to the function declaration, not the parameter; T should resolve to the type parameter of the class
    method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter.
}

//// [decoratorReferences.js]
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
let C = class C {
    method(x, y) { } // <-- decorator y should be resolved at the class declaration, not the parameter.
};
__decorate([
    y(null) // <-- y should resolve to the function declaration, not the parameter; T should resolve to the type parameter of the class
    ,
    __param(0, y)
], C.prototype, "method", null);
C = __decorate([
    y(1, () => C) // <-- T should be resolved to the type alias, not the type parameter of the class; C should resolve to the class
], C);
