// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// Test comparison of this and a constant.

class Foo {
  static final C1 = const Foo('C1');
  static final C2 = const Foo('C2');
  static final C3 = const Foo('C3');

  var name;
  const Foo(this.name);

  foo() {
    switch (this) {
      case C1: return C1;
      case C2: return C2;
      default: return null;
    }
  }
}

main() {
  Expect.equals(Foo.C1, Foo.C1.foo());
  Expect.equals(Foo.C2, Foo.C2.foo());
  Expect.equals(null, Foo.C3.foo());
}

// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// Test comparison of this and a constant.

class Foo {
  static final C1 = const Foo('C1');
  static final C2 = const Foo('C2');
  static final C3 = const Foo('C3');

  final name;
  const Foo(this.name);

  foo() {
    switch (this) {
      case C1: return C1;
      case C2: return C2;
      default: return null;
    }
  }
}

main() {
  Expect.equals(Foo.C1, Foo.C1.foo());
  Expect.equals(Foo.C2, Foo.C2.foo());
  Expect.equals(null, Foo.C3.foo());
}

Make field final in const class.
Make field final in const class.

TBR=ager@google.com

Review URL: https://chromiumcodereview.appspot.com//10446011

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@7947 260f80e4-7a28-3924-810f-c04153c831b5
