blob: 0a2603f55a4e042fb94657c89d8e973ba0d9d7bc [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 If a name N is referenced by a library L and N is introduced into
* the top level scope L by more than one import, and not all the imports denote
* the same declaration, then:
* - A static warning occurs.
* - If N is referenced as a function, getter or setter, a NoSuchMethodError is raised.
* - If N is referenced as a type, it is treated as a malformed type.
* It is neither an error nor a warning if N is introduced by two or more imports
* but never referred to.
* @description Checks that it if N is introduced into L by several imports
* that denote different declarations and N is referenced as a type, then it is
* treated as malformed.
* @static-warning
* @author kaigorodov
* @reviewer rodionov
*/
import "../../Utils/expect.dart";
import "1_Imports_A03_t01_p1_lib.dart";
import "1_Imports_A03_t01_p2_lib.dart";
main() {
// foo is malformed, then TypeError is thrown, not CastError
Expect.throws(() => 1 as foo, (e) => e is TypeError); // static warning
}