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

Bug: Non-optional initializers not available in package as per README #9

Open
ekscrypto opened this issue Mar 5, 2024 · 2 comments

Comments

@ekscrypto
Copy link

Describe the bug
The NonEmptyString type should not allow an empty string to be used as initializer

To Reproduce

@main
struct SafeTypeTestApp: App {
    let myString = NonEmptyString("")

    var body: some Scene {
        WindowGroup {
            let _ = myString
            ContentView()
        }
    }
}

Expected behavior
There should be a compile time or runtime error

Screenshots
Screenshot 2024-03-05 at 15 18 58

@ekscrypto
Copy link
Author

I noticed the documentation says this is the optional initializer, so I tried to use the macro but...

Screenshot 2024-03-05 at 15 22 13

@ekscrypto ekscrypto changed the title Bug: NonEmptyString can be initialized with empty string Bug: Non-optional initializers not available in package as per README Mar 5, 2024
@lucaswkuipers
Copy link
Owner

Thanks a lot for pointing this out! I'm updating the README to better reflect the APIs present in the isolated package!

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

No branches or pull requests

2 participants