Skip to content

inline val for opaque type alias for literal type is 'declared as erased, but is in fact used' #13852

Closed
@armanbilge

Description

@armanbilge

Compiler version

3.1.1-RC1

Minimized code

// This works:
inline val `1`: 1 = 1
def get1: 1 = `1`

// But this doesn't:
opaque type One = 1
inline val One: One = 1
def getOne: One = One
// getter One is declared as erased, but is in fact used

Output

[error] 32 |def getOne: One = One
[error]    |                  ^^^
[error]    |                  getter One is declared as erased, but is in fact used

Expectation

It should be possible to use an inline val of an opaque type alias for a literal type.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions