| Index: lib/compiler/implementation/lib/errors.dart
|
| diff --git a/lib/compiler/implementation/lib/errors.dart b/lib/compiler/implementation/lib/errors.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..319abc9e6538df5d40ae58d057ddbd7bc3704d05
|
| --- /dev/null
|
| +++ b/lib/compiler/implementation/lib/errors.dart
|
| @@ -0,0 +1,29 @@
|
| +// 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.
|
| +
|
| +class TypeErrorImplementation implements TypeError {
|
| + final String msg;
|
| + const TypeErrorImplementation(String this.msg);
|
| + String toString() => msg;
|
| +}
|
| +
|
| +/** Thrown by the 'as' operator if the cast isn't valid. */
|
| +class CastExceptionImplementation implements CastException {
|
| + // TODO(lrn): Change actualType and expectedType to "Type" when reified
|
| + // types are available.
|
| + final Object actualType;
|
| + final Object expectedType;
|
| +
|
| + CastExceptionImplementation(this.actualType, this.expectedType);
|
| +
|
| + String toString() {
|
| + return "CastException: Casting value of type $actualType to"
|
| + " incompatible type $expectedType";
|
| + }
|
| +}
|
| +
|
| +class FallThroughErrorImplementation implements FallThroughError {
|
| + const FallThroughErrorImplementation();
|
| + String toString() => "Switch case fall-through.";
|
| +}
|
|
|