hasTacitType

abstract fun hasTacitType(type: String): Boolean

Determines whether declaration has an explicitly declared type or if its value contains the given type with parentheses '('.

e.g.

val sampleProperty: Foo = someCollection.first() // hasTacitTypeOf(SampleClass::class) == true
val sampleProperty = Foo("some text") // hasTacitTypeOf(SampleClass::class) == true
val sampleProperty = someCollection.first() // hasTacitTypeOf(SampleClass::class) == false

Return

true if the type is explicitly declared or found with parentheses; false otherwise.

Parameters

type

The type to check.