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

Fix confusing download dialog popup #599

Merged
merged 1 commit into from
Apr 29, 2022
Merged

Conversation

hasufell
Copy link
Member

Fixes #597

@hasufell hasufell requested a review from fendor April 28, 2022 22:48
@@ -903,7 +905,7 @@ class InstalledTool {
* @param version Version of the tool, expected to be either SemVer or PVP versioned.
* @param installed Is this tool currently installed?
*/
public constructor(readonly name: string, readonly version: string = '', readonly installed: boolean = true) {
public constructor(readonly name: string, readonly version?: string, readonly installed: boolean = true) {
this.nameWithVersion = `${name}-${version}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will render now as "*-undefined" if it is ever shown which isn't much better, imo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't like this class, because we create an instance even if there is no such version. It obscures control flow. I'll have more time this evening.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will render now as "*-undefined" if it is ever shown which isn't much better, imo.

Well, if there's undefined falling through in this codepath, then that's a bug. Because undefined in this context means "default" and should have been resolved before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I also suck hard at OOP, so.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this class

Yeah, it is basically a record, not really a class.
Anyway, I prefer it over the unnamed tuple it was before :)

Because undefined in this context means "default" and should have been resolved before.

True

Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the quick fix!

@fendor fendor merged commit a910132 into haskell:master Apr 29, 2022
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.

Confusing dialog on startup: "Need to download ghc-null"
2 participants