Skip to content

export of opaque type alias from another package leads to type mismatch #12168

@Glavo

Description

@Glavo

Compiler version

3.0.0-RC3

Minimized code

package A {
    opaque type T = Int
    def t: T = 0
}

package B {
    export A.T
    val t: B.T = A.t
}

Output

[error] 8 |    val t: B.T = A.t
[error]   |                 ^^^
[error]   |Found:    A.T
[error]   |Required: B.T²
[error]   |
[error]   |where:    T  is a type in package object Main$package
[error]   |          T² is a type in package object Main$package which is an alias of A.T

If replace the package with object, or change the opaque type alias to another definition, it will not cause this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions