summaryrefslogtreecommitdiff
path: root/Test/dafny0/JustWarnings.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2015-07-06 14:46:51 -0700
committerGravatar Rustan Leino <unknown>2015-07-06 14:46:51 -0700
commitf177d7dc96b27f5ca3b777d31fcd9bad26be6ce5 (patch)
tree427e792f3623f3234e8e128010951813c37aed40 /Test/dafny0/JustWarnings.dfy
parent46611f3a604a2ab44d52fe2fa95070511e971100 (diff)
Report warnings only once. (This is the last step in fixing Issue #86.)
Diffstat (limited to 'Test/dafny0/JustWarnings.dfy')
-rw-r--r--Test/dafny0/JustWarnings.dfy19
1 files changed, 19 insertions, 0 deletions
diff --git a/Test/dafny0/JustWarnings.dfy b/Test/dafny0/JustWarnings.dfy
new file mode 100644
index 00000000..86523f5b
--- /dev/null
+++ b/Test/dafny0/JustWarnings.dfy
@@ -0,0 +1,19 @@
+// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" /warnShadowing "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+// This file tests the behavior where the Resolver reports some warnings
+// but no errors. In the case of errors, resolution does not continue
+// to clone modules and resolve them, but the cloning does proceed if there
+// are only warnings. Dafny should report only one copy of these warnings,
+// and warnings are therefore turned off when processing the clones. This
+// test file makes sure the warnings don't appear twice.
+
+method M(x: int)
+{
+ var x := 10; // warning: this shadows the parameter 'x'
+}
+
+class C<T> {
+ var u: T
+ method P<T>(t: T) // warning: this shadows the type parameter 'T'
+}