hylo
hylo copied to clipboard
Nested Product Type Compilation Issue
I came around a supposedly wrongly emitted compiler error when compiling the following code:
type A: Deinitializable {
public let x: Int
public memberwise init
public type B : Deinitializable {
public let x: Int
public memberwise init
}
}
public fun main() {
let a = A(x: 1)
let b = A(x: 1)
precondition(a.x == b.x)
let c = A.B(x: 1)
let d = A.B(x: 1)
precondition(c.x == d.x)
} // <- error
The error:
Tests/EndToEndTests/TestCases/DefaultImplementation.hylo:25.2: error: type 'B' does not conform to trait 'Deinitializable'
}
It seems that the default implementation is either not added to type B
or that the trait itself was not properly recorded for it.