const part = new MoviePart("Miranda Priestly", true);
part.role; // 타입: string
class IncorrectExtension implements ActingCredit<string> {
role: boolean;
// ~~~~~~~// ~~~~~~~
// Error: Property 'role' in type 'IncorrectExtension' is not// Error: Property 'role' in type 'IncorrectExtension' is not
// assignable to the same property in base type 'ActingCredit<string>'.// assignable to the same property in base type 'ActingCredit<string>'.
// Type 'boolean' is not assignable to type 'string'.// Type 'boolean' is not assignable to type 'string'.
}
10.3.4 10.3.4
메서드메서드
제네릭제네릭
클래스 메서드는 클래스 인스턴스와 별개로 자체 제네릭 타입을 선언할 수 있습니다. 제네릭
클래스 메서드에 대한 각각의 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.