has Tacit Type
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
Content copied to clipboard
Return
true
if the type is explicitly declared or found with parentheses; false
otherwise.
Parameters
type
The type to check.