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

Use Pick type to define Class prototype. #701

Merged
merged 5 commits into from Nov 13, 2023

Conversation

ajvincent
Copy link
Contributor

Fixes #696 .

@ajvincent
Copy link
Contributor Author

@Lodin I could use a little more help. I copied your test for Class (thank you very much for that), using better names, but I couldn't immediately come up with a good abstract class test in this scenario.

@sindresorhus
Copy link
Owner

@ajvincent Maybe ChatGPT can help. Can you try out this? https://chat.openai.com/share/232f2043-f201-40c6-8b7a-1fb8b9b96c80

@ajvincent
Copy link
Contributor Author

ajvincent commented Nov 11, 2023

@ajvincent Maybe ChatGPT can help. Can you try out this? https://chat.openai.com/share/232f2043-f201-40c6-8b7a-1fb8b9b96c80

No good. The problem is their test also passes under the current AbstractClass type. The same is true for any test case I can imagine.

(Sorry for the lengthy delay. I've been exceedingly busy in the last few weeks.)

@ajvincent
Copy link
Contributor Author

@sindresorhus
Copy link
Owner

@Emiyaaaaa Any ideas? ⬆️

@Emiyaaaaa
Copy link
Collaborator

@Emiyaaaaa Any ideas? ⬆️

Looks like it's been resolved by @ajvincent 👍

@sindresorhus
Copy link
Owner

@Emiyaaaaa No. It's still missing a test, as mentioned.

The problem is their test also passes under the current AbstractClass type. The same is true for any test case I can imagine.

⬆️

@Emiyaaaaa
Copy link
Collaborator

Obligatory playground link

Resolved here @sindresorhus

@ajvincent
Copy link
Contributor Author

ajvincent commented Nov 12, 2023

No, no, no, it had not been resolved. I posted that while I was still wandering around in the weeds.

The solution came to me while I was away from my desk yesterday: only the class needs to be abstract. Not the members. Other than that, it's the same test as Class gets.

In case it's unclear, it's fixed now. :)

@ajvincent
Copy link
Contributor Author

Playground Link

If line 33 says false extends true ?, the test fails. If line 33 says true extends true, the test passes. Which is what I was aiming for.

@sindresorhus sindresorhus merged commit 7294cf0 into sindresorhus:main Nov 13, 2023
6 checks passed
@ajvincent ajvincent deleted the class-prototype-pick branch November 13, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Class declaration is broken
3 participants