Skip to content

Commit

Permalink
Remove check for abstract classes
Browse files Browse the repository at this point in the history
  • Loading branch information
chippmann committed Nov 3, 2024
1 parent 0a3ffbe commit 2c11f9e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,9 @@ class ClassBuilderDsl<T : KtObject>(
}

internal fun build(): KtClass<T> {
check(constructors.isNotEmpty()) { "Please provide at least one constructor." }
if (!isAbstract) {
check(constructors.isNotEmpty()) { "Please provide at least one constructor." }
}
// Constraints.MAX_CONSTRUCTOR_ARG_COUNT + 1 because we have no arg constructor.
val constructorArray = arrayOfNulls<KtConstructor<T>>(Constraints.MAX_CONSTRUCTOR_ARG_COUNT + 1)
constructors.forEach {
Expand Down

0 comments on commit 2c11f9e

Please sign in to comment.