36f0c3209a
Change-Id: I7cfc51c22e98cc368ec59af3a7125f1d0c0419d8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407140 Auto-Submit: Bob Nystrom <rnystrom@google.com> Reviewed-by: Lasse Nielsen <lrn@google.com> Commit-Queue: Lasse Nielsen <lrn@google.com>
209 lines
7.8 KiB
Dart
209 lines
7.8 KiB
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.
|
|
|
|
var get;
|
|
var get a;
|
|
// [error column 1, length 3]
|
|
// [analyzer] SYNTACTIC_ERROR.VAR_RETURN_TYPE
|
|
// [cfe] The return type can't be 'var'.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] Expected a function body or '=>'.
|
|
var get b, c;
|
|
// [error column 1, length 3]
|
|
// [analyzer] SYNTACTIC_ERROR.VAR_RETURN_TYPE
|
|
// [cfe] The return type can't be 'var'.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.EXPECTED_EXECUTABLE
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] Expected '{' before this.
|
|
// [cfe] Expected a declaration, but got ','.
|
|
// [cfe] Expected a function body, but got ','.
|
|
// [cfe] Expected a function body, but got '{'.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
|
|
|
var set;
|
|
var set d;
|
|
// [error column 1, length 3]
|
|
// [analyzer] SYNTACTIC_ERROR.VAR_RETURN_TYPE
|
|
// [cfe] The return type can't be 'var'.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_PARAMETERS
|
|
// [cfe] A function declaration needs an explicit list of parameters.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] A setter should have exactly one formal parameter.
|
|
// [cfe] Expected a function body or '=>'.
|
|
var set e, f;
|
|
// [error column 1, length 3]
|
|
// [analyzer] SYNTACTIC_ERROR.VAR_RETURN_TYPE
|
|
// [cfe] The return type can't be 'var'.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_PARAMETERS
|
|
// [cfe] A function declaration needs an explicit list of parameters.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.EXPECTED_EXECUTABLE
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] A setter should have exactly one formal parameter.
|
|
// [cfe] Expected '{' before this.
|
|
// [cfe] Expected a declaration, but got ','.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
|
|
|
class C0 {
|
|
// ^
|
|
// [cfe] The non-abstract class 'C0' is missing implementations for these members:
|
|
var get;
|
|
var get a;
|
|
//^^^
|
|
// [analyzer] SYNTACTIC_ERROR.VAR_RETURN_TYPE
|
|
// [cfe] The return type can't be 'var'.
|
|
// ^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
|
|
var get b, c;
|
|
//^^^
|
|
// [analyzer] SYNTACTIC_ERROR.VAR_RETURN_TYPE
|
|
// [cfe] The return type can't be 'var'.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.EXPECTED_CLASS_MEMBER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] Expected '{' before this.
|
|
// [cfe] Expected a class member, but got ','.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
|
|
|
var set;
|
|
var set d;
|
|
//^^^
|
|
// [analyzer] SYNTACTIC_ERROR.VAR_RETURN_TYPE
|
|
// [cfe] The return type can't be 'var'.
|
|
// ^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_METHOD_PARAMETERS
|
|
// [cfe] A method declaration needs an explicit list of parameters.
|
|
// ^
|
|
// [cfe] A setter should have exactly one formal parameter.
|
|
var set e, f;
|
|
//^^^
|
|
// [analyzer] SYNTACTIC_ERROR.VAR_RETURN_TYPE
|
|
// [cfe] The return type can't be 'var'.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_METHOD_PARAMETERS
|
|
// [cfe] A method declaration needs an explicit list of parameters.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.EXPECTED_CLASS_MEMBER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] A setter should have exactly one formal parameter.
|
|
// [cfe] Expected '{' before this.
|
|
// [cfe] Expected a class member, but got ','.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
|
}
|
|
|
|
class C1 {
|
|
List? get;
|
|
List? get a => null;
|
|
List? get b, c;
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.EXPECTED_CLASS_MEMBER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] Expected '{' before this.
|
|
// [cfe] Expected a class member, but got ','.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
|
|
|
List? set;
|
|
List set d;
|
|
//^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
|
|
//^^^^^^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
|
|
// [cfe] The return type of the setter must be 'void' or absent.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_METHOD_PARAMETERS
|
|
// [cfe] A method declaration needs an explicit list of parameters.
|
|
// ^
|
|
// [cfe] A setter should have exactly one formal parameter.
|
|
List? set e, f;
|
|
//^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
|
|
// [cfe] The return type of the setter must be 'void' or absent.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_METHOD_PARAMETERS
|
|
// [cfe] A method declaration needs an explicit list of parameters.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.EXPECTED_CLASS_MEMBER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] A setter should have exactly one formal parameter.
|
|
// [cfe] Expected '{' before this.
|
|
// [cfe] Expected a class member, but got ','.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
|
}
|
|
|
|
class C2 {
|
|
List<int>? get;
|
|
List<int>? get a => null;
|
|
List<int>? get b, c;
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.EXPECTED_CLASS_MEMBER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] Expected '{' before this.
|
|
// [cfe] Expected a class member, but got ','.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
|
|
|
List<int>? set;
|
|
List<int> set d;
|
|
//^^^^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
|
|
//^^^^^^^^^^^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
|
|
// [cfe] The return type of the setter must be 'void' or absent.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_METHOD_PARAMETERS
|
|
// [cfe] A method declaration needs an explicit list of parameters.
|
|
// ^
|
|
// [cfe] A setter should have exactly one formal parameter.
|
|
List<int>? set e, f;
|
|
//^^^^^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
|
|
// [cfe] The return type of the setter must be 'void' or absent.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_METHOD_PARAMETERS
|
|
// [cfe] A method declaration needs an explicit list of parameters.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.EXPECTED_CLASS_MEMBER
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
|
|
// [cfe] A setter should have exactly one formal parameter.
|
|
// [cfe] Expected '{' before this.
|
|
// [cfe] Expected a class member, but got ','.
|
|
// ^
|
|
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
|
}
|
|
|
|
main() {
|
|
new C0();
|
|
new C1();
|
|
new C2();
|
|
}
|