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 type alias #102

Merged

Conversation

uncomputable
Copy link
Collaborator

Type aliases didn't parse as expected. This PR fixes that.

jet_verify -> assert!
I forgot to enforce the semicolon at the end of each type alias. This
meant that type aliases only parsed without semicolon, which is not the
intended behavior.

This commit adds a unit test to assert that type aliases can be parsed
as expected. Adding semicolons also makes one fuzz regression obsolete.
@uncomputable uncomputable force-pushed the 2024-12-fix-type-alias branch from 21f2400 to 4a18efe Compare December 9, 2024 17:43
@uncomputable
Copy link
Collaborator Author

Thank you, fuzz test, for catching a violated invariant.

@apoelstra
Copy link
Contributor

error: you seem to be trying to use `match` for an equality check. Consider using `if`
   --> src/value.rs:446:46
    |
446 |                   ValueInner::UInt(integer) => match print_hex_byte_array {
    |  ______________________________________________^
447 | |                     false => write!(f, "{integer}")?,
448 | |                     true => {} // bytes have already been printed
449 | |                 },
    | |_________________^ help: try: `if print_hex_byte_array == false { write!(f, "{integer}")? }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `-D clippy::single-match` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::single_match)]`

error: could not compile `simfony` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `simfony` (lib test) due to 1 previous error

I'm gonna disable clippy on my end for now -- but we should pin our nightly version of rust here!

Copy link
Contributor

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 4a18efe; successfully ran local tests

@apoelstra apoelstra merged commit 3a0499a into BlockstreamResearch:master Dec 10, 2024
12 checks passed
@uncomputable uncomputable deleted the 2024-12-fix-type-alias branch December 10, 2024 22:07
uncomputable added a commit to uncomputable/simfony that referenced this pull request Dec 12, 2024
Introduce a new wrapper type, AliasName, for strings that are valid
alias names. This makes sure that alias names are correctly sampled
by the Arbitrary trait.

Fixes BlockstreamResearch#102
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.

2 participants