Skip to content

Instantly share code, notes, and snippets.

@v6ak
Created May 2, 2013 14:58
Show Gist options
  • Select an option

  • Save v6ak/5502816 to your computer and use it in GitHub Desktop.

Select an option

Save v6ak/5502816 to your computer and use it in GitHub Desktop.
case object BoolType extends Type with StandardType{
def getCommonSuperType(other: Type) = other match {
case BoolType => BoolType
case _ => combineWith(other)
}
def getSimpleStringRepresentation = "Boolean"
def getClasses = Nil
}
final case class ArrayType(base: Type) extends Type{
def getCommonSuperType(other: Type) = other match {
case ArrayType(otherBase) => ArrayType(base getCommonSuperType otherBase)
case _ => combineWith(other)
}
def getSimpleStringRepresentation = "List["+base+"]"
def getClasses = base.getClasses
def getStandardStringRepresentation(naming: Map[ClassInfo, String]) = "List["+base.getStandardStringRepresentation(naming)+"]"
def getWrappedClass = base.getWrappedClass
def classNameSuggestions = base.classNameSuggestions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment