All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.mokkery.plugin.ir.IrFactory.kt Maven / Gradle / Ivy

Go to download

Mokkery is a mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.

The newest version!
package dev.mokkery.plugin.ir

import org.jetbrains.kotlin.ir.builders.declarations.buildClass
import org.jetbrains.kotlin.ir.declarations.IrClass
import org.jetbrains.kotlin.ir.declarations.IrFactory
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.name.Name

fun IrFactory.buildClass(name: Name, vararg superTypes: IrType?): IrClass {
    val newClass = buildClass { this.name = name }
    newClass.superTypes = superTypes.toList().filterNotNull()
    newClass.thisReceiver = newClass.buildThisValueParam()
    return newClass
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy