Skip to content

Commit

Permalink
exception fixed: define parameter index the old way if his grandparen…
Browse files Browse the repository at this point in the history
…t is not instance of ScParameters
  • Loading branch information
niktrop committed Apr 24, 2015
1 parent 71bdb29 commit dca6813
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -91,7 +91,10 @@ trait ScParameter extends ScTypedDefinition with ScModifierListOwner with
clause.isImplicit
}

def index = getParent.getParent.asInstanceOf[ScParameters].params.indexOf(this)
def index = getParent.getParent match {
case parameters: ScParameters => parameters.params.indexOf(this)
case _ => getParent.asInstanceOf[ScParameterClause].parameters.indexOf(this)
}

override def getName: String = {
val res = super.getName
Expand Down

0 comments on commit dca6813

Please sign in to comment.