Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-bucev committed Apr 26, 2023
1 parent e8a914a commit 07efcab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions frontends/benchmarks/verification/valid/i1401.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import stainless.lang._
import stainless.annotation._
import scala.collection.immutable.{Set => ScalaSet}

object i1401 {
case class Set[T](@extern @pure s: ScalaSet[T]) {
@extern
def apply(t: T): Boolean = s(t)

@extern
def subsetOf(that: Set[T]): Boolean = s.subsetOf(that.s)

@extern
def ++(that: Set[T]): Set[T] = {
Set(s ++ that.s)
}.ensuring(res => this.subsetOf(res) && that.subsetOf(res))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ trait FragmentChecker extends SubComponent { self: StainlessExtraction =>

// ignore param accessors because they are duplicates of constructor parameters.
// We catch them when we check constructors
if ((sym.tpe ne null) && !sym.isParamAccessor) {
// Also ignore *here* class constructors because they contain param accessors.
if ((sym.tpe ne null) && !sym.isParamAccessor && !sym.isClassConstructor) {
checkType(tree.pos, sym.tpe)
}
} else {
Expand Down

0 comments on commit 07efcab

Please sign in to comment.