-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ace5cad
commit 7557fa5
Showing
7 changed files
with
70 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
object i1529a { | ||
type ByteArray = Array[Byte] | ||
|
||
case class ByteArrayWrapper(ba: ByteArray) | ||
|
||
def test(baw: ByteArrayWrapper): Unit = { | ||
require(baw.ba.length == 64) | ||
baw.ba(0) = 3 | ||
val ba2 = baw.ba.updated(0, 4.toByte) | ||
assert(ba2(0) == 4) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import stainless.lang.* | ||
|
||
object i1529b { | ||
case class Key(i: BigInt) | ||
case class Value(i: BigInt) | ||
type MutableMapAlias = MutableMap[Key, Value] | ||
|
||
case class MutableMapWrapper(mm: MutableMapAlias) | ||
|
||
def test(mmw: MutableMapWrapper): Unit = { | ||
require(mmw.mm(Key(42)) == Value(24)) | ||
mmw.mm(Key(2)) = Value(4) | ||
val mmw2 = MutableMapWrapper(MutableMap.withDefaultValue(() => Value(123))) | ||
assert(mmw2.mm(Key(1)) == Value(123)) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
frontends/benchmarks/verification/valid/SetTypeAlias.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import stainless.lang.* | ||
|
||
object SetTypeAlias { | ||
type SetAlias = Set[Byte] | ||
|
||
case class SetAliasWrapper(sa: SetAlias) | ||
|
||
def test(saw: SetAliasWrapper, six: SetAliasWrapper): Unit = { | ||
require(saw.sa.contains(42)) | ||
val saucisse = saw.sa ++ six.sa | ||
assert(saucisse.contains(42)) | ||
} | ||
} |