blob: 8f1115c95959f6df514de87e660286097ad07c8b [file] [log] [blame]
/*
* 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.
*/
/**
* @assertion final E first
* Returns the first element.
* If this is empty throws a StateError.
* Otherwise this method is equivalent to this.elementAt(0).
* @description Checks that a StateError is thrown when this is empty.
* @author kaigorodov
*/
import "../../../Utils/expect.dart";
import "dart:collection";
main() {
LinkedList a = new LinkedList();
Expect.throws(() {
a.first;
},
(e)=> e is StateError
);
}