Skip to content
Snippets Groups Projects
Commit e87bc60e authored by Philippe Suter's avatar Philippe Suter
Browse files

No commit message

No commit message
parent 769a04ec
No related branches found
No related tags found
No related merge requests found
......@@ -64,18 +64,23 @@ class AnalysisComponent(val global: Global, val pluginInstance: FunCheckPlugin)
def unsup(s: String): String = "FunCheck: Unsupported construct: " + s
tree match {
case ClassDef(mods, name, tparams, impl) => {
if(mods.isTrait) unit.error(tree.pos, unsup("trait."))
}
case c @ ClassDef(mods, name, tparams, impl) => {
val s = c.symbol
println(s)
if(s.isTrait)
unit.error(tree.pos, unsup("trait."))
else if(s.isModule)
println("Seems like " + name + " is an object.")
else if(s.isClass && !(mods.isCase || mods.isAbstract))
unit.error(tree.pos, unsup("non-abstract, non-case class."))
}
case ValDef(mods, name, tpt, rhs) if mods.isVariable =>
unit.error(tree.pos, unsup("mutable variable/field."))
case LabelDef(name, params, rhs) => ;
// used for tailcalls and like
// while/do are desugared to label defs as follows:
// while (cond) body ==> LabelDef($L, List(), if (cond) { body; L$() } else ())
// do body while (cond) ==> LabelDef($L, List(), body; if (cond) L$() else ())
case LabelDef(name, params, rhs) => unit.error(tree.pos, unsup("loop."))
case Assign(lhs, rhs) => unit.error(tree.pos, unsup("assignment to mutable variable/field."))
case Return(expr) => unit.error(tree.pos, unsup("return statement."))
case Try(block, catches, finalizer) => unit.error(tree.pos, unsup("try block."))
......
......@@ -67,6 +67,7 @@ see examples in:
case class MapType(from: TypeTree, to: TypeTree) extends TypeTree
case class ClassType(id: Identifier) extends TypeTree
case class CaseClassType(id: Identifier) extends TypeTree
case class OptionType(base: TypeTree) extends TypeTree
// Definitions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment