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

toml: check if supported type was passed for decoding when it has no method #19317

Merged
merged 1 commit into from Sep 10, 2023

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Sep 9, 2023

🤖 Generated by Copilot at 5931238

This pull request improves the error handling of the toml.decode function by adding a compile-time check for the generic type parameter and a test case for it. It ensures that the function only accepts structs as the type parameter and returns a clear error message otherwise.

🤖 Generated by Copilot at 5931238

  • Add compile-time check for struct type in toml.decode function (link)
  • Add test cases for toml.decode function with non-struct types (link)
  • Assert that toml.decode function returns an error with the expected type name for non-struct types (link)

@ttytm ttytm changed the title toml: check if supported type was passed when it has no method toml: check if supported type was passed for decoding when it has no method Sep 9, 2023
@spytheman spytheman merged commit 12dd6e8 into vlang:master Sep 10, 2023
36 checks passed
Wertzui123 pushed a commit to Wertzui123/v that referenced this pull request Oct 8, 2023
…toml.decode`, when the type has no custom `.from_toml` method defined (vlang#19317)
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.

None yet

2 participants