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

[SR-7821] Provide a way to validate that a version is syntactically valid #4810

Open
ankitspd opened this issue May 31, 2018 · 2 comments
Open
Labels
bug good first issue Good for newcomers Edit

Comments

@ankitspd
Copy link
Member

Previous ID SR-7821
Radar rdar://problem/31742084
Original Reporter @aciidb0mb3r
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug, StarterBug
Assignee None
Priority Medium

md5: 46680a2c0ec36bb66247502e88b4930f

Issue Description:

Right now, calling `Utility.Version(string: foo)` with a user-entered string returns nil whenever the string is malformed in any way, but it doesn’t provide any diagnostics about what the problem is.

@swift-ci
Copy link
Contributor

swift-ci commented Jun 9, 2018

Comment by Shai Mishali (JIRA)

Hey there - I have 3 issues with solving this radar I'd love some help with.

  1. Injecting a `DiagnosticsEngine` breaks Auto-equatable (which is solved by removing the `#if !swift(>=4.1)` clause)

  2. Injecting a `DiagnosticsEngine` means passing it into all initializers of `Version`, which means to `init(json🙂` as well, breaking conformance to `JSONMappable`

  3. Like-wise, `ExpressibleByStringLiteral` is broken when injecting into its appropriate initializer.

Seems to me like the only way to solve this is to use a static/Singleton-style `DiagnosticsEngine` here but that seems backwards. Would appreciate any guidance 🙂

Thanks,
Shai.

@belkadan
Copy link

Resetting assignee for all Starter Bugs not touched since 2018.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@tomerd tomerd added good first issue Good for newcomers Edit and removed Package Manager labels May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Good for newcomers Edit
Projects
None yet
Development

No branches or pull requests

4 participants