Skip to content

Different type sizes for TupleN vs nested pairs encoding#24730

@mbovel

Description

@mbovel
packagedotty.tools.dotc.coreimportdotty.tools.DottyTestimportdotty.tools.dotc.core.Symbols.defnimportdotty.tools.dotc.core.TypeOpsimportorg.junit.Testimportorg.junit.Assert.assertEqualsclassTypesTestextendsDottyTest:@Testdeftuple3TypeSize=valtpe= defn.TupleType(3).nn.appliedTo(List(defn.IntType, defn.BooleanType, defn.DoubleType)) assertEquals(3, tpe.typeSize) // false, tpe.typeSize == 1 🤔@Testdeftuple3ConsTypeSize=valtpe=TypeOps.nestedPairs(List(defn.IntType, defn.BooleanType, defn.DoubleType)) assertEquals(3, tpe.typeSize)

Shouldn't the size of a 3-tuple always be 3, whereas it is encoded with a Tuple3 type application or with nested pairs?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions