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

A couple of bugs in forc fmt. #287

Closed
otrho opened this issue Oct 1, 2021 · 2 comments · Fixed by #317
Closed

A couple of bugs in forc fmt. #287

otrho opened this issue Oct 1, 2021 · 2 comments · Fixed by #317
Assignees
Labels
bug Something isn't working forc

Comments

@otrho
Copy link
Contributor

otrho commented Oct 1, 2021

I noticed the following when running forc fmt over the test suite:

struct A {
a: u64,
b: u64,
}
fn get_gas() -> A {
A {
a: asm() {
ggas
},
b: asm() {
cgas
}
}
}

is formatted to:

struct A {
    a: u64,
    b: u64,
}
fn get_gas() -> A {
    A {
        a: asm() {
            ,
            ggas
        }
        b: asm() {
            ,
            cgas
        }
    }
}

and the following:

enum B {
/// A docstring
A: u64,
/// B docstring
B: u64,
}

struct C {
/// a docstring
a: A,
/// b docstring
b: byte,
}

is formatted to:

enum B { /// A docstring
    A: u64, /// B docstring
    B: u64,
}

struct C { /// a docstring
    a: A, /// b docstring
    b: byte,
}
@otrho otrho added bug Something isn't working forc labels Oct 1, 2021
@sezna
Copy link
Contributor

sezna commented Oct 2, 2021

cc @leviathanbeak

@leviathanbeak
Copy link
Contributor

thanks @otrho for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants