Files
sdk/tests/language/library6.dart
T
hausner@google.com 9dc7ab8e1e Implement import scope
Implement the new scope rule for imports.

- Imported identifiers are in a scope that is shadowed
  by the importing library's top-level scope.
- Conflicting names imported from different libraries
  are not an error unless the name is referenced.
- Conflicting type names are only an error in checked mode.

In a follow-on change, I'll remove the "imported_into" pointers in libraries. They are no longer needed.


Issue 2945
Review URL: https://chromiumcodereview.appspot.com//10823396

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10923 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 21:06:16 +00:00

18 lines
687 B
Dart

// 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.
// This tests that it is a compile-time error to both import a library
// that defines a function type alias and to have a local definition for
// another function type alias with the same name.
// This name conflict is considered an error even if Fun is never referred to.
#library("Library6NegativeTest.dart");
#import("library5a.dart"); // Defines function type alias Fun
typedef int Fun(); // Does not conflict with definition of Fun from library5a
main() {
}