blob: 2dacadf91e4bc6ecbd1c88f30db73ab62e628003 [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.
// @dart = 2.9
/// @assertion It is a compile-time error if there is more than one entity
/// with the same name declared in the same scope.
/// Dart is lexically scoped. Scopes may nest. A name or declaration d is
/// available in scope S if d is in the namespace induced by S or if d is
/// available in the lexically enclosing scope of S. We say that a name or
/// declaration d is in scope if d is available in the current scope.
/// @description Checks that it is a compile-time error if a block statement
/// contains two functions with the same name.
/// @author msyabro
/// @reviewer iefremov
main() {
try {
{
void conflictingName() {};
conflictingName(p1) {};
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
} catch (e) {}
}