Skip to content

v fmt add unecessary shared in shared variable argument when in typeย #23151

Closed

Description

@andridus

Describe the bug

When I run v fmt . -w when I have a type with a shared variable, it does the wrong formatting and breaks when it compiles

Reproduction Steps

An example

module main

type Func = fn (shared state State) string

When I run v fmt . -w

it's update to

module main

type Func = fn (shared state shared State) string

and broken compilation because the incorrect addition of shared before State

Expected Behavior

In this case, I was expected that a shared would not be added before State

Current Behavior

This is fully described in Reproduction Steps

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.8 610558d

Environment details (OS name and version, etc.)

Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

Note

You can use the ๐Ÿ‘ reaction to increase the issue's priority for developers.

Please note that only the ๐Ÿ‘ reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Hulyยฎ: V_0.6-21588

Activity

  1. added
    BugThis tag is applied to issues which reports bugs.
    on Dec 13, 2024
  2. self-assigned this
    on Dec 13, 2024
  3. added
    Unit: vfmtBugs/feature requests, that are related to the `vfmt`, the formatter for V.
    Status: ConfirmedThis bug has been confirmed to be valid by a contributor.
    on Dec 13, 2024
  4. added a commit that references this issue on Dec 14, 2024
    bf9bb5c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugThis tag is applied to issues which reports bugs.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.Unit: vfmtBugs/feature requests, that are related to the `vfmt`, the formatter for V.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions