Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

section2/20: error TS2367 #26

Open
4BFC opened this issue Sep 1, 2024 · 0 comments · Fixed by #24
Open

section2/20: error TS2367 #26

4BFC opened this issue Sep 1, 2024 · 0 comments · Fixed by #24
Assignees
Labels
2회독 회독 🐞error 🐞error 👀question 👀question 🔄retry 🔄retry

Comments

@4BFC
Copy link
Member

4BFC commented Sep 1, 2024

✍Udemy/Ts/section2/20

🔗Reference

🐞ErroCode

  • error TS2367
    src/app.ts:18:5 - error TS2367: This comparison appears to be unintentional because the types 'Role.READ_ONLY' and 'Role.ADMIN' have no overlap.
    

📝Description

  • enum으로 key, value를 생성하고 person 객체에 role 속성에 enum의 key들로 초기값을 주었다. 이후 비교 연산으로 각기 다른 log를 확인하기 위한 코드를 작성했으나 이와 같은 에러가 발생했다. 원인 발생의 명확한 사유는 모르겠으나 Ts의 타입추론에서 발생한 문제로 여겨진다. 또는 아직 enum을 사용하는 방법을 잘 몰라서 발생한 문제로 여겨지고 있다. 이의 문제를 해결하게 된다면 해당 issue를 언급해서 해결하면 된다.

💡Solution

  • 아직 명확한 솔루션을 찾지 못했음.
@4BFC 4BFC added 🔄retry 🔄retry 👀question 👀question 🐞error 🐞error labels Sep 1, 2024
@4BFC 4BFC added this to the Udemy:TypeScript milestone Sep 1, 2024
@4BFC 4BFC self-assigned this Sep 1, 2024
@4BFC 4BFC pinned this issue Sep 1, 2024
@4BFC 4BFC linked a pull request Sep 1, 2024 that will close this issue
@4BFC 4BFC added the 2회독 회독 label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2회독 회독 🐞error 🐞error 👀question 👀question 🔄retry 🔄retry
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant