연결할 수 없는 코드
이 경고 카테고리의 철자는 [unreachable-code] 입니다.
연결할 수 없는 코드
무슨 일인가요?
코드의 명령에 연결할 수 없으며 실행될 수 없습니다.
왜 나쁜가요?
연결할 수 없는 코드는 프로그램 로직에 기여하지 않으며 애플리케이션의 디스크 및 메모리 사용 공간을 늘립니다. 연결할 수 없는 코드는 근본적인 버그나 논리 오류의 징후일 수 있습니다.
예시
function f(b: bool) : string {
if (b)
return "true"
else
return "false"
return "something else??" // unreachable statement
}이 경고를 해결하려면 죽은 명령어를 제거하거나 코드를 리팩터링하여 모든 로직에 도달할 수 있도록 하세요.
function f(b: bool) : string {
if (b)
return "true"
else
return "false"
}© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.