TypeInfer

com.bitblends.scalametrics.analyzer.TypeInfer
object TypeInfer

Provides functionality for inferring simplified string representations of types associated with terms (expressions) in Scala code. It includes utility methods for analyzing common patterns in type usage and converting them into human-readable or simplified format.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TypeInfer.type

Members list

Value members

Concrete methods

def inferSimpleType(rhs: Term): Option[String]

Infers a simplified string representation of the type associated with a given term.

Infers a simplified string representation of the type associated with a given term.

Note: This method uses heuristics and common patterns to deduce the type, and may not cover all possible cases. It is a recursive function that analyzes the structure of the term to determine its type.

Value parameters

rhs

the term for which the type is to be inferred

Attributes

Returns

an optional string representing the simplified type of the term, or None if the type cannot be inferred