Skip to content

Matching Classes #882

Closed
Closed
@scabug

Description

@scabug

Currently, Classes can't be directly matched against, one has to write it like:

def matchClass( s: String, clazz: Class[_] =
{
  clazz match {
    case x if x==classOf[String] => s
    case x if x==classOf[java.lang.Integer] = java.lang.Integer.valueOf( s )
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions