From 39e4e09deea64b34413fd5ddab512365b0bbbc7c Mon Sep 17 00:00:00 2001 From: Manos Koukoutos <emmanouil.koukoutos@epfl.ch> Date: Wed, 3 Aug 2016 14:07:44 +0200 Subject: [PATCH] Rename UnapplyPattern.id -> fd --- src/main/scala/inox/ast/CallGraph.scala | 2 +- src/main/scala/inox/ast/Expressions.scala | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/inox/ast/CallGraph.scala b/src/main/scala/inox/ast/CallGraph.scala index 5146be4a9..7cd906ba6 100644 --- a/src/main/scala/inox/ast/CallGraph.scala +++ b/src/main/scala/inox/ast/CallGraph.scala @@ -13,7 +13,7 @@ trait CallGraph { private def collectCallsInPats(fd: FunDef)(p: Pattern): Set[(FunDef, FunDef)] = (p match { - case u: UnapplyPattern => Set((fd, symbols.getFunction(u.id))) + case u: UnapplyPattern => Set((fd, symbols.getFunction(u.fd))) case _ => Set() }) ++ p.subPatterns.flatMap(collectCallsInPats(fd)) diff --git a/src/main/scala/inox/ast/Expressions.scala b/src/main/scala/inox/ast/Expressions.scala index 20fccb748..2700994fb 100644 --- a/src/main/scala/inox/ast/Expressions.scala +++ b/src/main/scala/inox/ast/Expressions.scala @@ -272,9 +272,9 @@ trait Expressions { self: Trees => } /** A custom pattern defined through an object's `unapply` function */ - case class UnapplyPattern(binder: Option[ValDef], id: Identifier, tps: Seq[Type], subPatterns: Seq[Pattern]) extends Pattern { + case class UnapplyPattern(binder: Option[ValDef], fd: Identifier, tps: Seq[Type], subPatterns: Seq[Pattern]) extends Pattern { // Hacky, but ok - def optionType(implicit s: Symbols) = s.getFunction(id, tps).returnType.asInstanceOf[ClassType] + def optionType(implicit s: Symbols) = s.getFunction(fd, tps).returnType.asInstanceOf[ClassType] def optionChildren(implicit s: Symbols): (ClassType, ClassType) = { val children = optionType.tcd.asInstanceOf[TypedAbstractClassDef].descendants.sortBy(_.fields.size) val Seq(noneType, someType) = children.map(_.toType) @@ -297,7 +297,7 @@ trait Expressions { self: Trees => val vd = ValDef(FreshIdentifier("unap", true), optionType) Let( vd, - FunctionInvocation(id, tps, Seq(scrut)), + FunctionInvocation(fd, tps, Seq(scrut)), IfExpr( IsInstanceOf(vd.toVariable, someType), someCase(CaseClassSelector(someType, vd.toVariable, someValue.id)), @@ -318,12 +318,12 @@ trait Expressions { self: Trees => */ def getUnsafe(scrut: Expr)(implicit s: Symbols) = CaseClassSelector( someType, - FunctionInvocation(id, tps, Seq(scrut)), + FunctionInvocation(fd, tps, Seq(scrut)), someValue.id ) def isSome(scrut: Expr)(implicit s: Symbols) = - IsInstanceOf(FunctionInvocation(id, tps, Seq(scrut)), someType) + IsInstanceOf(FunctionInvocation(fd, tps, Seq(scrut)), someType) } // Extracts without taking care of the binder. (contrary to Extractos.Pattern) -- GitLab