# 5.0 들어가며

타입 시스템의 역할은 결국 ‘어떤 자리에 들어가면 안 되는 값이 들어가 있는’ 상황을 찾아내는 것이다. 타입 시스템은 이런 상황을 발생시키는 코드를 보고하기 위해 타입 오류를 사용한다. 그렇다면 타입 시스템은 어떤 값이 어떤 자리에 들어가도 되는지 아닌지를 어떻게 판단할까? 다르게 표현하자면, **타입 시스템은 서로 다른 타입의 호환 가능성을 어떻게 판단할까?**

이 장에서는 기본 타입에서부터 시작해 제너릭, 클래스를 비롯한 복잡한 타입들까지, 타입의 호환성 비교가 어떻게 이루어지는지 하나씩, 구체적으로 알아볼 것이다. 타입 호환성을 판단하는 원리를 이해함으로써, 앞으로 타입스크립트 코드를 짜며 마주칠 에러 메시지를 더 잘 이해하고 보다 나은 설계를 할 수 있을 것이다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ahnheejong.gitbook.io/ts-for-jsdev/05-type-compatibility/intro.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
