// Copyright (c) 2011, 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. import "package:expect/expect.dart"; // Test for F-Bounded Quantification. class FBound> {} class Bar extends FBound {} class SubBar extends Bar {} class Baz extends FBound> {} class SubBaz extends Baz {} isCheckedMode() { try { var i = 1; String s = i; return false; } catch (e) { return true; } } main() { FBound fb = new FBound(); { bool got_type_error = false; try { FBound fsb = new FBound(); // //# 01: static type warning } on TypeError catch (error) { got_type_error = true; } // Type error in checked mode only. Expect.isTrue(got_type_error == isCheckedMode()); // //# 01: continued } FBound> fbb = new FBound>(); { bool got_type_error = false; try { FBound> fsb = new FBound>(); // //# 02: static type warning } on TypeError catch (error) { got_type_error = true; } // Type error in checked mode only. Expect.isTrue(got_type_error == isCheckedMode()); // //# 02: continued } }