blob: 4d70225e5a04c363e613d8fa68df1467b01fc937 [file] [log] [blame]
/*
* Copyright (c) 2019, 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
* <extension> ::=
* `extension' <identifier>? <typeParameters>? `on' <type> `?'? `{'
* memberDeclaration*
* `}'
* If an extension declaration is only used locally in a library, there might be
* no need to worry about naming conflicts or overrides. In that case, then name
* identifier can be omitted (hence the <identifier>? in the grammar above).
* This is equivalent to giving the extension a fresh private name.
*
* @description Check that the extension name can be ommitted
* @author sgrekhov@unipro.ru
*/
import "my_fancy_list_lib.dart";
main() {
List<String> list = ["Lily", "was", "here"];
list.nnDoubleLength;
// ^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] The getter 'nnDoubleLength' isn't defined for the class 'List<String>'.
List.nnClassName;
// ^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] Getter not found: 'nnClassName'.
}