repo stringclasses 966
values | path stringlengths 5 283 | license stringclasses 13
values | stars int64 0 3.47k | default_branch stringclasses 15
values | commit_sha stringclasses 966
values | pushed_at stringdate 2015-04-17 10:56:12 2026-07-22 05:29:38 | size_bytes int64 0 1.91M | sha256 stringlengths 64 64 | content stringlengths 0 1.91M |
|---|---|---|---|---|---|---|---|---|---|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4233.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 245 | b8d3f450e6c4eaa9ec72921778287ca631c6a27e6a5b7e4de105767f51768875 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
newtype MyReal = real
method Main() {
var x: MyReal := 12.0 / 10.0;
print x, "\n"; // expect 1.2
if x == 1.0 {
assert false;
print "unreachable\n";
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-425.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 467 | c4f8f6145ab8de1ba16ac0cac2f7f4d21ea08001ff25f6972a9acc04e3e198f6 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method M() returns (x: int, ghost y: int) {
return 42, 43;
}
datatype Color = Red | Blue
method Main() {
var x0, y0 := M(); // this is fine: x0 is compiled, y0 is ghost
print x0, "\n";
var c := Red;
mat... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4261.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,916 | 140a537decf502b8c6e448f513da81a4bf1f21018b0a9bd20d15b8f3b44b3b5e | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module M {
// 0
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
// 10
// 11
// 12
// 13
// 14
// 15
// 16
// 17
// 18
// 19
// 20
// 21
// 22
// 23
// 24
// 25
// 26
// 27
/... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4272.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 377 | 9ce07842cda73be25562ebda118af4d3e3b8d272d4813475573b7d5ce5877a4a | // RUN: %verify --type-system-refresh "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module Bar {
class Foo {
// The following line once used to give an error, because newtype "b1" had not yet been resolved
const c0: b1 := 4
}
newtype b1 = x | 0 <= x < 11/2
}
module Zar {
newtype b1 = x | 0 <=... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4284.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 134 | 7b160ff323014b509af4fe5db341ddce020e96d91fbb3565cfc592b2a5380eed | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --compile-suffix
method Main() {
print (true, false), "\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4298.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 194 | e31de541125ccab31e7dab06a74e8c31e10f252693d22e9a0e36d94c078fc5ff | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
export E
provides f
function f() : bool { true }
}
abstract module B {
import A0: A
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4309.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 577 | c1bdf0c61b122b18d9b987dfdbdb5116642b411a4117175b7d03cd34cb4a3f0a | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Main() {
CallFromTextuallyAbove.Test();
CallFromTextuallyBelow.Test();
}
class CallFromTextuallyAbove {
static method Test() {
var x := new Class;
x.M();
print x.m, "\n";
}
}
class Class {
const m: int := 18
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4315.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 148 | e36a59c8bed81da415e362e7705fe0429be8449c41f7aaa4661b82d41bc59222 | // RUN: %testDafnyForEachResolver "%s"
module M1 {
class C {
opaque function f() : bool { true }
}
}
module M2 refines M1 {
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4394.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 590 | f34a815832cfd03cbe2ff9a43093935a9d00919fc3c18b4b72c1b91034661825 | // RUN: %verify --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype T = T(
f:map<nat,nat>
) {
const Keys := f.Keys // Used to be an error
}
codatatype codatatypeT = CT(
f:map<nat,nat>
) {
const Keys := f.Keys // Used to be an error
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-442.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 99 | 4e3683a97916f180ba978b62c381a1ac8700e5325f6d73bb981ab34e7af1bca1 | // RUN: %resolve "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method m()
ensures false
{
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-443.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 595 | 41e99d1c685a73d55d4dffe243e6bcf1f355ccb2804ed1ac8904491c2941306f | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main() {
print F(), " ", G(802.11), "\n"; // 12 15
}
function F(): int {
var rx := false;
assert 20 < 30 by {
var u := 5.0; // this once caused a crash in Translator.cs
assert u < 6.0;
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4449.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 374 | ad0567f629f1c931fba7508f58d1dea3804cdfe6488ac8d6a47753f78abd97ba | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
module AnyName {
class B {
const i := 1
constructor() {}
}
class AnyName {
const j: B
constructor ()
{
this.j := new B();
}
}
}
method Main() {
var b := new AnyName.B();
var an := new AnyName... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-446.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,413 | 6872b015feb6d0ba3137561f6f6e3566e2f4abce9234bf338c15d58564c1b6cb | // RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment
datatype Result<T> = Success(value: T) | Failure(error: string)
{
predicate IsFailure() {
Failure?
}
function PropagateFailure<U>(): Result<U>
requires Failure?
{
Failure(this.error)
}
function Extract(): T
r... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-446a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,577 | 8f0ffe3393472002c05ee097845bf026bc08ab752ddd9397783ce4c805df7253 | // RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment
datatype Result<T> = Success(value: T) | Failure(error: string)
{
predicate IsFailure() {
Failure?
}
function PropagateFailure<U>(): Result<U>
requires Failure?
{
Failure(this.error)
}
}
class A {
method mn() re... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-446b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,699 | 1aa94dc5ae9f959f42cebba92fb8d4cbffec82dc480ae951c6d90d4e45b442c1 | // RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment
datatype Result<T> = Success(value: T) | Failure(error: string)
{
predicate IsFailure() {
Failure?
}
function PropagateFailure<U>(): Result<U>
requires Failure?
{
Failure(this.error)
}
}
method mn() returns (r: R... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-446e.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 678 | 9de0a19cc738a8fbb206f6ac2659f6674809c82b93ac7caafaabe61944bfee8e | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Result<T> = Success(value: T) | Failure(error: string)
{
predicate IsFailure() {
Failure?
}
function PropagateFailure<U>(): Result<U>
requires Failure?
{
Failure(this.error)
}
function Extract(): T
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-448.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 863 | 4c2c28415874890e8c8d9f1ab388c057d94c3012f83e5fc9ca55f95afc70570e | // RUN: %exits-with 4 %run "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C {
var u: int
method M() {
}
function F(): int {
5
}
}
codatatype Stream<G> = More(x: G, tail: Stream<int>)
method Main() {
var c: C;
var s: Stream<bool>;
print s.x, "\n"; // error: "s" hasn't been init... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-452.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 345 | 0c81922fe80acc3c9a265a1693cd92b66099539a370223eda6e24ef8400c6aba | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
ghost function TwinPrimes(): (int, int) {
(41, 43)
}
function TwinPrimesM(): (int, int) {
(41, 43)
}
method Main() {
var (x, y) := TwinPrimesM(); // x and y are not ghost
var p := TwinPrimesM(); // p is not ghost
print x, " ", y, "... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-452a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 659 | 7c201ee0e250f7d31774ee2f29ecc9464221f3c748dc9087f8842505a5d4ba93 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
ghost function TwinPrimes(): (int, int) {
(41, 43)
}
function TwinPrimesM(): (int, int) {
(41, 43)
}
method Main() {
var (x, y) := TwinPrimesM(); // x and y are not ghost
var p := TwinPrimesM(); // p is not ghost
print x, " ", y, ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-452b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 397 | d7dec8b511d3ba6e04fbbfaaa666ca85b0908123d5c2865efe358837d5a81f63 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Record = Record(a: int, ghost b: int)
function TwinPrimes(): Record {
Record(41, 43)
}
method Main() {
var w := var Record(x, y) := TwinPrimes(); x; // x and w are non-ghost
var u := var Record(x, y) := TwinPrimes(); y... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-452c.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 372 | 471315eff84511123e4a4681f182ab0204c0219b08ebf0263ca468de82b85a12 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
datatype Record = Record(a: int, ghost b: int)
function TwinPrimes(): Record {
Record(41, 43)
}
method Main() {
var u := var Record(x, y) := TwinPrimes(); y; // x is non-ghost
var w := var Record(x, y) := TwinPrimes(); x; // x and w are non... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4684.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 932 | 9ff9457ea79f05f65e9eeac347f3093da1e72c83b8f3fef3e98baab37764e17d | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
class C {
var data: nat
var next: C?
constructor (n: nat) {
data := n;
if n == 0 {
next := null;
} else {
next := new C(n - 1);
}
}
function FWithoutTailRecursion(n: nat, g: () ~> int): int
requires... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4724.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 245 | f363134b8103b749f4945fff531e2307d86a1008e241d6114d967bc78853b252 | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
type seq31<T> = x: seq<T> | |x| <= 31
method TakeThis(x: seq31<int> := [])
{
TakeThis(); // Error: cannot prove termination; try supplying a decreases clause
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4731.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 444 | 3041a96c92d207111cc933211dc530144d78c4dbc2fc8f172fd5ae29aa337596 | // RUN: %testDafnyForEachResolver "%s"
datatype Option<T> = Some(val: T) | None {
predicate IsFailure() {
None?
}
function PropagateFailure<V>(): Option<V>
requires None?
{
None
}
function Extract(): T
requires Some?
{
val
}
}
function Foo0(): Option<bool>... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4768.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 170 | 8d55258c5c25b35d5fe058df75b3e649acf1706e060ddb8115ea9e8dc016335c | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
abstract module A {
opaque predicate Valid<R>(n: int)
{ true }
}
abstract module B refines A {
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4778.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,162 | 704b87cad7c8a5b1654380be408a608ccca5319ef47e1dec72c21e4554facc94 | // RUN: %verify --warn-contradictory-assumptions --allow-warnings "%s" > "%t"
// DIFF: "%s.expect" "%t"
type CodeUnit
type CodeUnitSeq = seq<CodeUnit>
type MinimalWellFormedCodeUnitSeq = s: CodeUnitSeq
| IsMinimalWellFormedCodeUnitSubsequence(s)
witness *
function IsMinimalWellFormedCodeUnitSubsequence(s... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-478-errors.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,766 | 4a7f30909f1338846f8687edb27bdd56ca08d4e25b9c257dcc6d9063a87ca3a3 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
// The LibA and LibB examples are the same, except for the order of declarations.
//
import LibA // error: duplicate module (note, error is on import, not the module)
module LibA { }
module LibB { }
import LibB // error: duplicate module (note,... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-478-good.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,553 | adc771378f8679e2bb68b8d4aca7b97cb67321bf3a4839d124f3eff0c7943d70 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
// By first defining import LibA and then defining a module LibA,
// the latter used to generate:
// duplicate module name: LibA
// This now works, and the effect is to imported LibA opened and
// not introduce anothe... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4787.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 471 | 5e7ba0400d25d1049018d3f5380692986eb2e6e3e21d0ffbcd461eb84b3e6dcd | // RUN: %exits-with 4 %verify --warn-redundant-assumptions --allow-axioms --warn-contradictory-assumptions --show-snippets:true "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module M {
opaque function ToSet(xs: seq<int>): set<int> {
set x: int | x in xs
}
lemma LemmaCardinality(xs: seq<int>)
ensur... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4812.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 367 | 1c160e8e4d3cff1febcb7201fa29b09c438c912be5d3105e01562b1096a728ae | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
trait ProblemHolder<T(!new, ==)> {
ghost function Solution(): T
predicate Problem(solution: T)
ensures Solution() == solution
}
trait Instantiation extends ProblemHolder<int> {
ghost function Solution(): int
predicate Problem(soluti... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4823.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 283 | 9abfcc252e969c11d060e7d06fd834448c18c5634b40ff81655043e2f41ac0e6 | // RUN: %baredafny verify %args --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
trait Test<T> {
function Cast(t: T): Test<T>
}
datatype Impl extends Test<Impl> = ImplConstructor()
{
function Cast(t: Impl): Test<Impl> { t }
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4830.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 64 | f9981d83a4de9e4ce2f21581e2134f68a8c10949824a23032002d0a8a6e912ae | // RUN: %testDafnyForEachCompiler "%s"
datatype None = None
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-484.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,327 | 0bc80c026e79deee96cca6c9ea415cc442682a789e5041d3631f3e9d1aa18b6c | // RUN: %exits-with 2 %build --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
newtype MyInt = int
datatype Bar = Bar(b: MyInt)
ghost function update0(bar: Bar, i: int): Bar {
// Regression test: the following once suppressed the error:
bar.(b := i) // error... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4844.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 324 | 7cf67e067918e19fb530a271e23d9645351447d96f5108dc2c3f137623c2e6d7 | // RUN: %exits-with 4 %baredafny verify %args "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method Ooops()
ensures false
{
var x := new O();
assert AllocationSoundness(x);
}
class O {
var x: int
constructor() {}
}
twostate predicate AllocationSoundness(o: O)
ensures old(allocated(o))
{ true... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4866.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 387 | 4e4b764c6baeb4b867d70fd99388ca174c7e076530ef673c35db251545cbcc63 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module A {
type R<T, U> = T
datatype D<U> = D(x: R<string, U>)
method Foo<U>(x: R<string, U>)
{
var _ := D(x);
}
}
module B {
type MyType<X>
type R<T, U> = T
datatype D<U> = D(x: R<MyType<char>, U>)
method Foo(x... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4893.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 170 | f0d01c273a47dbbbfbb06ffc30ff22c5349194a3f38c5a84d6ad327aef54d7b4 | // RUN: %testDafnyForEachResolver --expect-exit-code=0 "%s"
module A
{
export
provides T
newtype T = int
}
module B
{
import A
type X = A.T
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4926.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,241 | fdeb9c2891df9408d5ca1d6fb8a9f42615d9c0e406b64b95bf857064880a01f1 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module Basics {
function F<A(!new)>(): int
function G<A(0)>(): int
function H<A(00)>(): int
function J<A(==)>(): int
type Cmp<A(==)>
class Cell { }
type Nonempty = x: int | x % 2 == 0 ghost witness 4
datatype Record = Record(x: ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4936a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 463 | 69a89cb2e03651e4a39e39ba4df384cb906cf987befef1887cca5b3ba32c0695 | // RUN: %testDafnyForEachResolver "%s" -- --general-traits:datatype
module X {
trait {:termination false} A extends object {}
}
module Y {
import opened X
trait B extends A {
function GetIndex(): nat
// The following once gave an error, complaining that B is not a reference type. The probl... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4936b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 571 | 46649abf6b8dd0f884a52f4507eaf1071423c04208df391da67c802d99a844cd | // RUN: %testDafnyForEachResolver "%s" -- --general-traits:datatype
module X {
trait K { }
trait {:termination false} A extends object, K {}
}
module Y {
import opened X
trait B extends A { }
method Test(b: B) returns (a: A) {
// The following assignment once caused malformed Boogie to be... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4936c.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,383 | a843f48961f291bfea9b955d968a28d89af25d958a855ad9d63b76d18d03e634 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --general-traits:datatype
// The early-resolver code that figures out if a trait is a reference type or not is operating so early
// in the resolver pipeline that opened imports have not yet been resolved into the importing module.
// Thus, this early-... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4936d.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,265 | c34720b96acf16f21ed2a2b4de3cef2c107d4dbc3b3c2b896d5be2ba0e606809 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --general-traits:datatype
module X {
export Public
provides A
export Friends
reveals A
trait {:termination false} A extends object {}
}
module Y0 {
import opened X`Public
trait B extends A { // error: A is not even known ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4939a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 5,085 | 09a8322a82d01150b4f9dccb6be77f742059404540b9a3eecd5c7d1a0874c7e1 | // RUN: %exits-with 4 %verify --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module FromIssue0 {
trait Program {
method Compute() returns (r: Result)
}
datatype Result =
| Bounce(next: Program)
| Done()
datatype Trivial extends Program =
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4939b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 806 | 41f8b47f1c87a87da23579eeb76747f210b1aabebfa438449d2be4be5817fec3 | // RUN: %exits-with 4 %verify --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module NoAutoInit {
trait GeneralTrait { }
trait ReferenceTrait extends object { }
datatype A = A(g: GeneralTrait)
datatype B = B(h: ReferenceTrait)
method Test() {
var a:... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4939c.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 420 | e6a90135f9e3b70aba260ddbffcd1b7b0aee0f8ddea5cd28443fc318624ea6bc | // RUN: %testDafnyForEachCompiler "%s" -- --general-traits=datatype
module NoAutoInit {
trait GeneralTrait { }
trait ReferenceTrait extends object { }
datatype A = A(g: GeneralTrait)
datatype B = B(h: ReferenceTrait)
method Main() {
// Test that code generation succeeds, even thought "a" and ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 467 | 48c89908c00ab7834707bcfc920f95b4bf7fd208d48c287cff5389b75a9f4ac9 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --general-traits=datatype
trait ProgramTrait {
method Compute() returns (r: Result)
}
type Program = ProgramTrait | true // error: 'ProgramTrait' is a bound variable here, and its type is undetermined
datatype Result =
| Bounce(next: Program... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 328 | 9530169caee89cd41771fcc0ab5727d90d22d92cc1ae676dd183392a10083000 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --general-traits=legacy
trait GeneralTrait { }
trait ReferenceTrait extends object { }
type SubsetType = x: GeneralTrait | true // error: cannot find witness (tried null)
type Reference = x: ReferenceTrait | true // error: cannot find witness (tried... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946c.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 339 | ba20bea15337b9794ae38b716833101ee3d532bc4685fdf682e97779a9e7cc9d | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --general-traits=datatype
trait GeneralTrait { }
trait ReferenceTrait extends object { }
type SubsetType = x: GeneralTrait | true // error: cannot find witness (didn't try anything)
type Reference = x: ReferenceTrait | true // error: cannot find wit... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946d.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 325 | 4d8c45e240da7ce4e85764389446decb30b1060bef560f4b816850ca9b529762 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --general-traits=datatype --general-newtypes
type Small = x: int | 0 <= x < 10
newtype NewProgram = Small | true // error: 'Small' is a bound variable here, and its type is undetermined
datatype Result =
| NewBounce(newNext: NewProgram)
| Don... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-495.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,141 | 6b96f629d3379a46f0bd825ea8f26d016ea141366372f7c587235e8c237ff558 | // RUN: %exits-with 4 %build "%s" --relax-definite-assignment > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Dt = Make(d: int)
function GetNat(dt: Dt): nat {
match dt
// regression: the following declaration of y was once missing the subet-constraint check
case Make(y: nat) => y // error: dt.d is not a... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4952.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 729 | ac9fcaff92c587a9b12972fd5b79de6cbcc0609b3f16d343a0995bf5192f47c8 | // RUN: %testDafnyForEachResolver "%s" -- --general-traits=datatype
trait A<K> {
function FunctionRequires(): bool
requires true
function FunctionReads(): bool
reads {}
decreases 2
function FunctionEnsures(): bool
ensures true
method MethodRequires()
requires true
method Met... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4953.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 483 | c116b8b94073202fbd8cbd113b3150ed226b95944d81cfd848af90bfdf272394 | // RUN: %testDafnyForEachResolver "%s" --expect-exit-code=2
// The lookup of a non-existing member once caused a crash in the new resolver.
function Foo(): (result: seq<int>)
ensures result.NonExistingMember
function Bar(formal: seq<int>): int
requires formal.NonExistingMember
method Zap(i: seq<int>) ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4982.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 830 | 4cf079aaa21c57ac775905219acfb9b3a4c0965d464a680555374b480454d0e1 | // RUN: %testDafnyForEachResolver "%s" -- --general-traits:datatype
trait Tr1 {
function Decrease(): nat {
0
}
function F(): nat
decreases Decrease()
}
datatype Dt1 extends Tr1 = Dt {
function F(): nat
decreases 0
{
0
}
}
trait Tr2<A> {
function Decrease(): nat {
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4983.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,073 | 1b140aa16bdec96690dc00ba8e7c2aa43fcd085da5576a63c356871c0d9dbd6e | // RUN: %testDafnyForEachResolver --expect-exit-code=2 --refresh-exit-code=0 "%s" -- --general-traits:datatype
trait Parent {}
datatype Dt extends Parent = Dt {
function GetParent(): Parent {
// The implicit conversion in the following line once caused malformed Boogie to be generated
this // error (... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4994.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,262 | a9244a044c675663c3ccf57781575f567060115d95014f145280ca44e6358621 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 --refresh-exit-code=4 "%s" -- --general-traits=datatype
trait Parent {}
datatype D extends Parent = D
codatatype Co extends Parent = Co
method TestAEq(d: D, co: Co, p: Parent) {
// The expressions in these assertions once caused malformed Boogie
if
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4998.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 198 | 96e4dc9eb3bd3b2d10620b8fa6ba6f01bb04ced4b3227d8efff860fc750f6c3f | // RUN: %testDafnyForEachResolver "%s"
// this once crashed, because the implicit postcondition didn't include the type parameter
predicate Foo<A>() {
true
} by method {
return true;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5017a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,440 | 84641d8bedf4989d05a6382af0090e7bb730f250bc1e15620656928618bbefdc | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --general-traits=datatype
module True {
trait A {
ghost predicate Valid()
}
trait B extends A {
ghost opaque predicate Valid() { true }
}
method TestByRequires(b: B)
requires b.Valid()
{
var a: A := b;
asser... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5017b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,564 | f3d35e907fbe99f857710f289cfe24fec7dfbe2dfb8ef933372d68490fd0390b | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --general-traits=datatype
module Opaque {
trait A {
predicate Valid()
}
trait B {
opaque predicate Valid() { true }
}
trait C {
opaque predicate Valid()
}
trait K0 extends A {
predicate Valid()
}
tra... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5017c.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,712 | 64da4f302d23cd22a59e7279a4600df2ba0ffd557e5a2d8498dc944115f4d75f | // RUN: %exits-with 4 %verify --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module Datatype {
trait A {
opaque predicate Valid()
}
datatype B extends A = B {
opaque predicate Valid() { true }
}
datatype C extends A = C {
opaque predicate... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5023.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,460 | 4c3829d2d0373a81822e70dc3ef56014b65bb41891f66e87d770ebd939af0a0c | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
// ---------- compiled variables/fields ----------
module GhostWitness {
type Five = x: int | x == 5 ghost witness 5
class ContainsFive {
var five: Five
constructor () {
five := *;
} // error: five not defined
}
me... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-503.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 585 | 7781259b913728e9ff8fd42ae513338162d1f79bbfbca0739a0e1332439ba554 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module Option {
datatype t<A> = None | Some(A)
}
module P {
datatype t = P
}
module Bug {
import Option
import P
datatype input = Input(z: Option.t<P.t>)
type t = input -> bool
const Foo: t := (x: input) =>
match x
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-504.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 318 | d7ac8f82527e69ed2a12c56f3c426a345b35c89963f4e2ac98b276136d7bfbe0 | // RUN: %testDafnyForEachResolver "%s"
module List {
datatype t<A> = Nil | Cons(A, t<A>)
}
module Bug1 {
import List
function foo(x: List.t<char>, y: List.t<char>): List.t<char> {
match (x, y)
case (Cons(_, _), _) => List.Cons('-', List.Nil)
case (Nil, _) => List.Nil
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5048.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 150 | 93d68ebac3e3d87f48a225f5161890c7112328ecc429ebdf3235d45671348519 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
module A.try {
datatype Dt = Dt
}
method Main() {
print A.try.Dt, "\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-505.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 592 | dfffe096aa4eb154f94ab1cdea2cec1a9bbded594a10436e130ae2c3350394cf | // RUN: %verify --verification-time-limit 20 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
lemma d()
{
var a: int := 0x0000_0000_0000_BEEF;
var testbv: bv16 := a as bv16;
var testval: int := testbv as int;
assert testval == a; // OK
}
lemma e()
{
var a: int := 0x0000_0000_0000_00EF;
var testbv:... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-506.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,701 | 4e8d97ffcc9e27f362f83cdef03f62ba948f287df134650802f7044f06d977b9 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main() {
var a := new int[10];
var index := 6;
a[8] := 1;
a[index], index := 3, index+1;
assert a[6] == 3;
assert index == 7;
print index, " ", a[6], a[7], a[8], "\n"; // Should be: "7 301"
i... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5065.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 219 | 90f0a74fd6939239bb1794f16484b02c7175a58f69c1d369ec2bb850b43338ba | // RUN: %testDafnyForEachCompiler "%s"
const TWO_TO_THE_8: int := 0x100
newtype uint8 = x: int | 0 <= x < TWO_TO_THE_8
method Main() {
var i: uint8 := 10;
var s: seq<uint8> := seq(i, _ => 0);
print s;
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5092.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 214 | 31b9aa7b1d0de87295102ddc16125f753ebe188733274e1221369b4831602cf7 | // RUN: %testDafnyForEachCompiler "%s"
function True(): bool {
if false
then false
else if (_ => false)(false)
then false
else true
}
method Main(){
print True(), "\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5136.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,287 | bbd9e2fb8ef746107833acc00588ff22f9bae7cdd6e39ea632beaab1d0e3b2fb | // RUN: %exits-with 4 %verify --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
type Empty = x: int | false witness *
class TestEmpty {
const x: Empty
constructor ()
ensures false
{
x := 2; // error: RHS does not satisfy type constraint for Empty
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5238.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 393 | 2fa0646a5bdac31efaf91c3d6f732f7a002437c07a7f72025072882bdc80b758 | // RUN: %testDafnyForEachCompiler "%s"
// RUN: %testDafnyForEachCompiler "%s" -- --allow-deprecation --unicode-char=false
method Main() {
var s: seq<char>;
s := *;
print "(", s, ") ", s == "", " ", "" == s, " ", |s|, "\n";
s := "";
print "(", s, ") ", s == "", " ", "" == s, " ", |s|, "\n";
s := "h... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5262.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,287 | 5d6b69a24d4548057fb591caba08db29754590e5b55c2be39af3678a3cb8d58e | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function F(a: array<int>): int
requires a.Length > 0
{
a[0] // Suggests to "read a"
}
class C {
var data: int
function G(): int {
// Amazing! I don't think I've ever thought about that ` has really low binding power,
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5274.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 570 | 7e3b0dc0cf075b5b0a768dcddaaaa55cd0eeb5980f3886ce0dfc38c109d076a2 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
datatype Pair<T(==)> = MakePair(0: T, 1: T) {
function Same(): bool {
this.0 == this.1
}
}
method ReturnFalse() returns (b: bool)
ensures !b
{
var c := (2, ghost 5);
var d := (2, ghost 6);
assert c != d;
b := MakePair(c, d).Sa... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5283.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,161 | 6e871ef5a0188e0ab909e2291ee8042742dca9281b323ca6afdbd97d39a8f5f7 | // RUN: %testDafnyForEachCompiler "%s"
/* Obtained from
https://pkg.go.dev/std
by running on the console
copy([...document.querySelectorAll(
"td > div.UnitDirectories-pathCell > div > span, "+
"td > div.UnitDirectories-pathCell > div > a")]
.map(e => "module " + e.textContent + " {}").join("\n"))
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5285.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 422 | b1ea2a837a2d6cf0df0d96cdcf0f59e1a9e955e3eb1386084af1447c80607941 | // RUN: %testDafnyForEachCompiler "%s"
const someSet :=
set
someString <- {"D"},
someChar <-
set c <- someString :: c
:: someChar
const someMap :=
map x |
0 < x < 3
&& x in
map y : int | 0 <= y <= x :: y
:: x * x
method Main() {
print someSet, "\n";
/... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-532.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 769 | 54fcc1b2cc0a076a7e5a5b18a3b6ce48dfdc914e1acb5995321b61b6920d3b62 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
predicate SuppressNoTriggerWarning<X>(x: X) { true }
trait Tr extends object {
var x: int
}
class C extends Tr {
var y: int
}
class D extends Tr {
var z: int
}
method M(t: Tr)
modifies t
{
print... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5331.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 475 | 61ab045e23e6330015655e040bdf39e59b5958628edaed1d8adf6440fea8510e | // RUN: %baredafny verify %args --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
trait Ins {
function step(s: State): State
}
type Code = seq<Ins>
datatype State = S(
clock: nat
) {
function fetch_(): Ins
const fetch := fetch_()
const step := fe... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5365.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 207 | d14153ef2ef86101c1504d5601ccab233f85095e19eb99f6c9868b6c61d0e50a | // RUN: %baredafny verify %args --type-system-refresh "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype S = S(
n:nat
) {
function f():S { this }
function g():S { this.(n := 0).f() }
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5369.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,071 | ff8da14008fe340020b77a0600d6a387c4676e4fab26c4525e9ebd4fff6ee020 | // RUN: %exits-with 2 %baredafny verify %args --type-system-refresh "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
ghost function f2(items: set<nat>): (r:nat)
requires |items| > 0 {
var item :| item in items;
item
}
function f(items: set<nat>) : (r:nat)
requires |items| > 0 {
//assume exists item... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5469.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 276 | 17c930809e00ee4d4c9e7afcc9feebe1c1e6f3e748c405c25ccfc1534d86193c | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
module SomeDependencyModule {
datatype None = None
}
module SomeModule {
import SomeDependencyModule
const test := SomeDependencyModule.None
}
method Main() {
print SomeModule.test, "\n";
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-549.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 391 | 1b50bee653c056a342fe5210a50a67063578e100f2cd06201c21da71750c1f6c | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
trait T {
function bar(): bv8
}
class F extends T {
// once upon a time, the following used to crash Dafny
function bar(): bv8 {
1
}
}
method Main() {
var f: F := new F;
print "bar() = ", f.bar(... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-551.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 631 | 8a857a5ca194b2b24769a0d3e2e680e988726f4252fa60b6a303f4ff5264f9ce | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
datatype VoidOutcome =
| VoidSuccess
| VoidFailure(error: string)
{
predicate IsFailure() {
this.VoidFailure?
}
function PropagateFailure(): VoidOutcome requires IsFailure() {
this
}
}
function Require(b: bool)... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5520.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,481 | c2a5161226f195d0a86de3abf7160f70d0b9d92e5380ef2b5439186f30dcec7e | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module SubsetTypeSubsetType {
type Empty = x: int | false witness *
method OperateOnEmpty(x: Empty)
ensures false
{
}
type PurportsToBeNonempty = x: Empty | true
witness 506 // error: this is not a witness
method Test() {
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5521.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,580 | 4767efdd73ae1460752a3781b95e60dee08b3037d79e042b8d3e83af6a8bae84 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module WithoutWitnessClause {
type Empty = x: int | false witness *
newtype NewEmpty = Empty // error: the default-witness 0 is not a witness
method OperateOnNewEmpty(x: NewEmpty)
ensures false
{
var y: Empty := x as Empty;
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5523.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 244 | 8a092704b2143404718e411c0a23b0a26f54e096f278cd29fbede210fc6a1cd9 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
function Loop(xs: seq<()>): ()
{
if |xs| == 0
then ()
else
var _: bool -> bool := e => e;
Loop(xs[1..])
}
method Main(){
print Loop([(), ()]), "\n";
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-555.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 492 | 75e697549a5e5df76d47c8b32b40966f87d408c9a7ddcf08d8afabe550156abf | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: ! %run --no-verify --target cs "%s" >> "%t"
// RUN: ! %run --no-verify --target js "%s" >> "%t"
// RUN: ! %run --no-verify --target go "%s" >> "%t"
// RUN: ! %run --no-verify --target java "%s" >> "%t"
// RUN: %diff "%s.expect" "%t"
method Main() {
g(10);
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5554.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 445 | e65263030eb6d96d59fb1340827ece93cdbd9904fad41f513ec28e6e8adb2fa2 | // RUN: %dafny -compile:4 -compileTarget:cs "%s"
datatype MultisetContainer = EmptySet | BooleanMultiset(containerSet: multiset<bool>)
method Main() {
var initialMultiset := multiset{false};
for iteration := 0 to 31 {
var multisetInstance := BooleanMultiset(initialMultiset);
in... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5570.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 667 | ecd2ad942008a4360b227518af2c89b0a4b9f30e6ffbb64b7b9f41b0677687e1 | // RUN: %verify --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module Class {
trait Parent { }
class Record extends Parent {}
function Pick(b: bool, r: Record, d: Parent): Parent {
if b then r else d
}
method Select(b: bool, r: Record, d: Parent)... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5572.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 229 | e21b8bae6993a00a388570b29d61eaaa1fcca85ec00bd4b43b8ed59618cdc6d6 | // RUN: %testDafnyForEachCompiler "%s"
datatype D = A(int) | C(int) {
function Test(): D {
match this{
case A(_) | C(_) =>
this
}
}
}
method Main() {
var x := C(0).Test();
print "ok";
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5586.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 298 | 74180cf09d6b966e3137519fc3a0e198eec01e93aefe3bcd70ce01f8c422a88f | // RUN: %exits-with 4 %verify --type-system-refresh "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
trait Trait { }
class Class extends Trait { }
predicate P(t: Trait) {
t is Class // this is the related location of the error below
}
method M(u: Trait) {
assert P(u); // error
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5597.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,347 | c70a8fdf15afff4d8393e0bbc827b78565db7c167c45c66eb1e878e34e331f31 | // RUN: %testDafnyForEachCompiler "%s" -- --type-system-refresh=false --general-newtypes=false --general-traits=legacy
// Note, these tests seem to be specific to the old type system. With the new type system,
// assignments that, in some way, involve a conversion from Number to Integer require an
// explicit "as"... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5637.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 112 | 104a27072d813221e265b62fb0d50b72e6f804e62f3c40ee39f473916f82bba3 | // RUN: %translate cs %trargs --include-test-runner --allow-warnings %s > "%t"
// RUN: %diff "%s.expect" "%t"
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5642.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 210 | 5f01353b37f5dc58a33ce2609717f2e37c0d85d2c5023c29d66fe2e7b8805ade | // RUN: %testDafnyForEachCompiler "%s"
class Cl {
const c: bool
constructor(c: bool) {
this.c := c;
this.c := c;
}
}
method Main() {
var cl := new Cl(false);
print cl.c, "\n";
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5643.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 216 | 57d521e352d0ab8c7caf40d997375d961d432e8e099938a3f01f6641a69f6646 | // RUN: %testDafnyForEachCompiler "%s"
datatype D = A | B
const c := set d: D | true :: d
datatype {:rust_rc false} E = F | G
const h := set e: E | true :: e
method Main() {
print |c|, |h|, "\n";
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5644.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 683 | 10b4a30b68292585c1685f60a6ac1197b8c42dcdc8c856070ca6fecd7d509f5f | // NONUNIFORM: Testing robustness of Dafny/Rust backends wrt set comprehension
// RUN: %baredafny build --function-syntax:3 --target:rs --enforce-determinism "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module Spoo {
newtype uint8 = x: int | 0 <= x < 0x100
newtype uint16 = x: int | 0 <= x < 0x10000
function... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5647.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 495 | 2d0afa5e5c577c53d9468e3afb9c2563f4763f5e94572173feb7b2487054e3d5 | // RUN: %testDafnyForEachCompiler "%s"
// Verify shadowing
function {:tailrecursion} GetSum(
a_b': nat,
ac_c: string)
: string
{
if a_b' == 0 then
ac_c
else
var j := a_b';
var a_b' := if a_b' % 2 == 0 then "1" else "0";
GetSum(j - 1, ac_c + a_b')
}
function GetSumAuto(x: na... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5719.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 668 | b75a3b75d5f29ca68f83bba53115cc9f8dda17e5d1d4753eb7153dcf31e251a7 | // RUN: %verify --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
trait G {}
trait Thing<A, G1 extends G> {
function Get(): (a: A)
ensures P(a)
predicate P(a: A) {
Q(a)
}
predicate Q(a: A)
}
datatype D extends G = Dd
method TestD<A>(thing... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5726a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 991 | 555dc9990a8ed49a9ecc8c7b2e379cf875bdc1a858cba295083086b582716610 | // RUN: %exits-with 2 %verify --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// Type errors from Issue 5726 (see also git-issue-5726b.dfy)
module Example0 {
trait G {
const Three := 3
const Six := Three + Three
}
class E extends G { }
method D... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5726b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,135 | b9e146b453ce2a67b3783605b7cd2c2e4e7224379ac91c43fe3765afed3927d1 | // RUN: %exits-with 4 %verify --type-system-refresh --general-traits=datatype "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// Verification errors from Issue 5726 (see also git-issue-5726a.dfy)
module Example1 {
trait G extends object {
const Three := 3
const Six := Three + Three
}
class E exte... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-580.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 195 | b419bcc9b0c21ed6fca0aba3005e395938dc239cf744e982a3421d60fc6447ff | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
trait A {}
trait B {}
class C extends A, B {
method Foo() {
assert false; // error: but this once used to pass
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5873.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 506 | 86d3462d794e8be61dc74073e324c8b9ff62b11e968b511f7c3c40b93909ffa5 | // RUN: %verify --type-system-refresh --general-traits=datatype --bprint "%t.bpl" "%s"
// RUN: %boogie "%t.bpl" > "%t"
// RUN: %diff "%s.expect" "%t"
trait Parent {
method M() returns (r: nat)
function F(): nat
}
datatype Dt<K(!new)> extends Parent = Dt {
method M() returns (r: nat) {
r := 0;
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-588.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 243 | f3841230af8212f9770bedfe9fbea00bf6df13cfdfcf1fc09d95e2a3a7857d93 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
module myclass {
class MyClass {
var num: int
constructor (x: int) {
num := x;
}
}
method Main() {
var c_obj := new MyClass(2);
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-590.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 95 | b1476bac1c15754cf80465ae8676464ad504758e4fa43a1d220e858ccac62534 | // dafny should emit exit value 1
// RUN: ! %run x.cs > "%t"
// RUN: %diff "%s.expect" "%t"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.