8000 Wrong values in multiple generics with Ints · Issue #82615 · swiftlang/swift · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Wrong values in multiple generics with Ints #82615
Open
@MichaelAdalbert

Description

@MichaelAdalbert

Description

If a generic takes multiple Int parameter, all values will correspond to the first value

Reproduction

struct Point2D<let x: Int, let y: Int> {}

extension Point2D : CustomStringConvertible { 
    var description: String {
        get {
            "\(x) \(y)"
        }
    }
}

let p2d = Point2D< 1, 10>()
print("\(p2d)")

struct Point3D<let x: Int, let y: Int, let z: Int> {}

extension Point3D : CustomStringConvertible { 
    var description: String {
        get {
            "\(x) \(y) \(z)"
        }
    }
}

let p3d = Point3D< 1, 10, 200>()
print("\(p3d)")

Expected behavior

Each generic parameter should have its own value

Environment

Swift version 6.2-dev (LLVM 4197ac1672a278c, Swift acbdfef)
Target: x86_64-unknown-linux-gnu
Build config: +assertions

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0