@@ -8,6 +8,7 @@ package viper.silver.ast.utility
88
99import java .util .concurrent .atomic .AtomicInteger
1010import reflect .ClassTag
11+ import scala .annotation .unused
1112
1213object GenericTriggerGenerator {
1314 case class TriggerSet [E ](exps : Seq [E ])
@@ -193,7 +194,7 @@ abstract class GenericTriggerGenerator[Node <: AnyRef,
193194 })
194195
195196 /* Collect all the sought (vs) variables in the function application */
196- processedArgs foreach (arg => visit (arg) {
197+ processedArgs foreach (arg => getVarsInExp (arg) foreach {
197198 case v : Var =>
198199 if (nestedBoundVars.contains(v)) containsNestedBoundVars = true
199200 if (allRelevantVars.contains(v)) containedVars +:= v
@@ -210,17 +211,25 @@ abstract class GenericTriggerGenerator[Node <: AnyRef,
210211 })
211212 }
212213
214+ def getVarsInExp (e : Exp ): Set [Var ] = {
215+ var result : Set [Var ] = Set ()
216+ visit(e) {
217+ case v : Var => result += v
218+ }
219+ result
220+ }
221+
213222 /*
214223 * Hook for clients to add more cases to getFunctionAppsContaining to modify the found possible triggers.
215224 * Used e.g. to wrap trigger expressions inferred from inside old-expression into old()
216225 */
217- def modifyPossibleTriggers (relevantVars : Seq [Var ]): PartialFunction [Node , Seq [Seq [(PossibleTrigger , Seq [Var ], Seq [Var ])]] =>
226+ def modifyPossibleTriggers (@ unused relevantVars : Seq [Var ]): PartialFunction [Node , Seq [Seq [(PossibleTrigger , Seq [Var ], Seq [Var ])]] =>
218227 Seq [(PossibleTrigger , Seq [Var ], Seq [Var ])]] = PartialFunction .empty
219228
220229 /*
221230 * Hook for clients to identify additional variables which can be covered by triggers.
222231 */
223- def additionalRelevantVariables (relevantVars : Seq [Var ], varsToAvoid : Seq [Var ]): PartialFunction [Node , Seq [Var ]] = PartialFunction .empty
232+ def additionalRelevantVariables (@ unused relevantVars : Seq [Var ], @ unused varsToAvoid : Seq [Var ]): PartialFunction [Node , Seq [Var ]] = PartialFunction .empty
224233
225234 /* Precondition: if vars is non-empty then every (f,vs) pair in functs
226235 * satisfies the property that vars and vs are not disjoint.
0 commit comments