Closed
Description
Compiler version
3.1.1-RC1
Minimized code
// This compiles:
opaque type One = 1
inline val One: One = 1
// But this does not:
opaque type Max = Int.MaxValue.type
inline val Max: Max = Int.MaxValue
// inline value must have a literal constant type
// However, this does:
inline val MaxValue: Int.MaxValue.type = Int.MaxValue
Output
[error] 33 |inline val Max: Max = Int.MaxValue
[error] | ^^^
[error] | inline value must have a literal constant type
[error] one error found
Expectation
If it is possible to inline a value of literal type Int.MaxValue
, it should be possible to inline an opaque alias of that.