FIR IDE: Enforce an order on subclasses of sealed class

Currently the order is non-determinstic, causing non-determinstic
behavior in the IDE diagnostics. This change enforces an alphabetic
order.
This commit is contained in:
Tianyu Geng
2021-03-19 15:02:19 -07:00
committed by Dmitriy Novozhilov
parent c198c57e62
commit 8805675539
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ sealed class Variant {
object Another : Variant()
}
fun nonExhaustiveSealed(v: Variant) = <error descr="[NO_ELSE_IN_WHEN] 'when' expression must be exhaustive, add necessary 'is Something', 'Another' branches or 'else' branch instead">when</error>(v) {
fun nonExhaustiveSealed(v: Variant) = <error descr="[NO_ELSE_IN_WHEN] 'when' expression must be exhaustive, add necessary 'Another', 'is Something' branches or 'else' branch instead">when</error>(v) {
Variant.Singleton -> false
}