Ignore non-singleton subtypes of ErrorCode when creating error code documentation. (#14829)

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Matthias Schmalz 2022-08-25 14:59:42 +02:00 committed by GitHub
parent fe703c6c67
commit 7728d61565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,8 +3,6 @@
package com.daml.error.generator
import java.lang.reflect.Modifier
import com.daml.error._
import org.reflections.Reflections
@ -188,10 +186,8 @@ object ErrorCodeDocumentationGenerator {
.getSubTypesOf(runtimeMirror.runtimeClass(ru.typeOf[T]))
.asScala
.view
.collect {
case clazz if !Modifier.isAbstract(clazz.getModifiers) =>
clazz.getDeclaredField("MODULE$").get(clazz).asInstanceOf[T]
}
.filter(_.getDeclaredFields.exists(_.getName == "MODULE$"))
.map { clazz => clazz.getDeclaredField("MODULE$").get(clazz).asInstanceOf[T] }
.toSeq
private def simpleClassName(any: Any): String =