inferRecordDeclaration

fun inferRecordDeclaration(type: Type, kind: String = "class", locationHint: Node? = null): RecordDeclaration?

Infers a record declaration for the given type. type is the object type representing a record that we want to infer. The kind specifies if we create a class or a struct.

Since Type does not contain a location, a separate node that contains a location can optionally be specified in locationHint. This could for example be a call expression that contained the reference to a class method.