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

Add type checks to TOMLValueConvertible conversions #13

Merged
merged 2 commits into from
Mar 31, 2022

Conversation

stackotter
Copy link
Contributor

Fixes #12

The tests all pass on my machine, and it fixes the fatal crash for me.

The following code snippet now runs and throws a (non-fatal) error as expected:

import Foundation
import TOMLKit // stackotter/TOMLKit ~> 00de25703c71d965e62dec711660c96482c9e1db

let string = """
[[apps.test]]
"""

struct Child: Codable {
    var value: String
}

struct Parent: Codable {
    var apps: [String: Child]
}

try? TOMLDecoder().decode(Parent.self, from: string)

@stackotter
Copy link
Contributor Author

I accidentally had my indentation set to spaces instead of tabs in my original commit, so I've fixed that now

@LebJe
Copy link
Owner

LebJe commented Mar 31, 2022

@stackotter Thanks for the fix! I will make a new release soon.

@LebJe LebJe merged commit c02913d into LebJe:main Mar 31, 2022
@stackotter
Copy link
Contributor Author

Awesome, thanks for merging so quickly!

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.

Fatal crash (may be caused by a bug in toml++)
2 participants