summaryrefslogtreecommitdiff
path: root/BCT/Test/test1/Locals.cs
blob: f07c0e3fc3145e3da8872593c7bdf096a686e3b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using System.Collections.Generic;
//using System.Diagnostics.Contracts;

class Program
{
  private int i;

  void M0(int j) {
    i = 7;
    int k;
    k = i + 20;
    i = k / j;  // error: possible division by zero
  }

  void M1(int j) {
    //    Contract.Requires(0 < j);
    if (!(0 < j)) throw new Exception();
    i = 7;
    int k = i + 20;
    i = k / j;
  }
}