Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2991. Fix typos and separate tests with external #2992

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Language/Types/Type_Void/type_void_A06_t11.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ main() {
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified}
}
5 changes: 1 addition & 4 deletions LanguageFeatures/nnbd/static_errors_A04_t21.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with a
/// `late` or `external `modifier. Test type `Never`.
/// `late` modifier. Test type `Never`.
/// @author sgrekhov@unipro.ru

// Requirements=nnbd-strong

late Never n1;
external Never n2;

class C {
static late Never n1;
static late final Never n2;
external static Never n3;
external static final Never n4;
}

main() {
Expand Down
5 changes: 1 addition & 4 deletions LanguageFeatures/nnbd/static_errors_A04_t22.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with a
/// `late` or `external `modifier. Test type `Function`.
/// `late` modifier. Test type `Function`.
/// @author sgrekhov@unipro.ru

// Requirements=nnbd-strong

late Function x1;
external Function x2;

class C {
static late Function x1;
static late final Function x2;
external static Function x3;
external static final Function x4;
}

main() {
Expand Down
5 changes: 1 addition & 4 deletions LanguageFeatures/nnbd/static_errors_A04_t23.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with a
/// `late` or `external `modifier. Test a function type.
/// `late` modifier. Test a function type.
/// @author sgrekhov@unipro.ru

// Requirements=nnbd-strong

typedef void Foo();

late Foo x1;
external Foo x2;

class C {
static late Foo x1;
static late final Foo x2;
external static Foo x3;
external static final Foo x4;
}

main() {
Expand Down
5 changes: 1 addition & 4 deletions LanguageFeatures/nnbd/static_errors_A04_t24.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with a
/// `late` or `external `modifier. Test some class.
/// `late` modifier. Test some class.
/// @author sgrekhov@unipro.ru

// Requirements=nnbd-strong

class A {}

late A x1;
external A x2;

class C {
static late A x1;
static late final A x2;
external static A x3;
external static final A x4;
}

main() {
Expand Down
5 changes: 1 addition & 4 deletions LanguageFeatures/nnbd/static_errors_A04_t28.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with a
/// `late` or `external `modifier. Test type `FutureOr<Never>`.
/// `late` modifier. Test type `FutureOr<Never>`.
/// @author sgrekhov@unipro.ru

// Requirements=nnbd-strong

import "dart:async";

late FutureOr<Never> x1;
external FutureOr<Never> x2;

class C {
static late FutureOr<Never> x1;
static late final FutureOr<Never> x2;
external static FutureOr<Never> x3;
external static final FutureOr<Never> x4;
}

main() {
Expand Down
10 changes: 1 addition & 9 deletions LanguageFeatures/nnbd/static_errors_A04_t29.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with a
/// `late` or `external `modifier. Test `FutureOr<F>` where `F` is a function
/// type.
/// `late` modifier. Test `FutureOr<F>` where `F` is a function type.
/// @author sgrekhov@unipro.ru

// Requirements=nnbd-strong
Expand All @@ -20,19 +19,12 @@ typedef void Foo();

late FutureOr<Function> f1;
late FutureOr<Foo> f2;
external FutureOr<Function> f3;
external FutureOr<Foo> f4;

class C {
static late FutureOr<Function> x1;
static late final FutureOr<Function> x2;
static late FutureOr<Foo> x3;
static late final FutureOr<Foo> x4;

external static FutureOr<Function> x5;
external static final FutureOr<Function> x6;
external static FutureOr<Foo> x7;
external static final FutureOr<Foo> x8;
}

main() {
Expand Down
5 changes: 1 addition & 4 deletions LanguageFeatures/nnbd/static_errors_A04_t30.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with a
/// `late` or `external `modifier. Test `FutureOr<A>` where `A` is some class.
/// `late` modifier. Test `FutureOr<A>` where `A` is some class.
/// @author sgrekhov@unipro.ru

// Requirements=nnbd-strong
Expand All @@ -18,13 +18,10 @@ import "dart:async";
class A {}

late FutureOr<A> x1;
external FutureOr<A> x2;

class C {
static late FutureOr<A> x1;
static late final FutureOr<A> x2;
external static FutureOr<A> x3;
external static final FutureOr<A> x4;
}

main() {
Expand Down
6 changes: 1 addition & 5 deletions LanguageFeatures/nnbd/static_errors_A04_t33.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with a
/// `late` or `external `modifier. Test `FutureOr<FutureOr<A>>` where `A` is
/// some class.
/// `late` modifier. Test `FutureOr<FutureOr<A>>` where `A` is some class.
/// @author sgrekhov@unipro.ru

// Requirements=nnbd-strong
Expand All @@ -19,13 +18,10 @@ import "dart:async";
class A {}

late FutureOr<FutureOr<A>> x1;
external FutureOr<FutureOr<A>> x2;

class C {
static late FutureOr<FutureOr<A>> x1;
static late final FutureOr<FutureOr<A>> x2;
external static FutureOr<FutureOr<A>> x3;
external static final FutureOr<FutureOr<A>> x4;
}

main() {
Expand Down
25 changes: 25 additions & 0 deletions LanguageFeatures/nnbd/static_errors_A04_t35.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2024, 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 It is an error if a top level variable or static variable with a
/// non-nullable type has no initializer expression unless the variable is
/// marked with a `late` or `external` modifier.
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with an
/// `external` modifier. Test type `Never`.
/// @author sgrekhov22@gmail.com

// Requirements=nnbd-strong

external Never n1;

class C {
external static Never n1;
external static final Never n2;
}

main() {
C();
}
25 changes: 25 additions & 0 deletions LanguageFeatures/nnbd/static_errors_A04_t36.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2024, 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 It is an error if a top level variable or static variable with a
/// non-nullable type has no initializer expression unless the variable is
/// marked with a `late` or `external` modifier.
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with an
/// `external` modifier. Test type `Function`.
/// @author sgrekhov22@gmail.com

// Requirements=nnbd-strong

external Function x1;

class C {
external static Function x1;
external static final Function x2;
}

main() {
new C();
}
27 changes: 27 additions & 0 deletions LanguageFeatures/nnbd/static_errors_A04_t37.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) 2024, 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 It is an error if a top level variable or static variable with a
/// non-nullable type has no initializer expression unless the variable is
/// marked with a `late` or `external` modifier.
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with an
/// `external` modifier. Test a function type.
/// @author sgrekhov22@gmail.com

// Requirements=nnbd-strong

typedef void Foo();

external Foo x1;

class C {
external static Foo x1;
external static final Foo x2;
}

main() {
new C();
}
27 changes: 27 additions & 0 deletions LanguageFeatures/nnbd/static_errors_A04_t38.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) 2024, 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 It is an error if a top level variable or static variable with a
/// non-nullable type has no initializer expression unless the variable is
/// marked with a `late` or `external` modifier.
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with an
/// `external` modifier. Test some class.
/// @author sgrekhov22@gmail.com

// Requirements=nnbd-strong

class A {}

external A x1;

class C {
external static A x1;
external static final A x2;
}

main() {
new C();
}
27 changes: 27 additions & 0 deletions LanguageFeatures/nnbd/static_errors_A04_t39.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) 2024, 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 It is an error if a top level variable or static variable with a
/// non-nullable type has no initializer expression unless the variable is
/// marked with a `late` or `external` modifier.
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with an
/// `external` modifier. Test type `FutureOr<Never>`.
/// @author sgrekhov22@gmail.com

// Requirements=nnbd-strong

import "dart:async";

external FutureOr<Never> x1;

class C {
external static FutureOr<Never> x1;
external static final FutureOr<Never> x2;
}

main() {
new C();
}
32 changes: 32 additions & 0 deletions LanguageFeatures/nnbd/static_errors_A04_t40.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) 2024, 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 It is an error if a top level variable or static variable with a
/// non-nullable type has no initializer expression unless the variable is
/// marked with a `late` or `external` modifier.
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with an
/// `external` modifier. Test `FutureOr<F>` where `F` is a function type.
/// @author sgrekhov22@gmail.com

// Requirements=nnbd-strong

import "dart:async";

typedef void Foo();

external FutureOr<Function> f1;
external FutureOr<Foo> f2;

class C {
external static FutureOr<Function> x1;
external static final FutureOr<Function> x2;
external static FutureOr<Foo> x3;
external static final FutureOr<Foo> x4;
}

main() {
new C();
}
29 changes: 29 additions & 0 deletions LanguageFeatures/nnbd/static_errors_A04_t41.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2024, 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 It is an error if a top level variable or static variable with a
/// non-nullable type has no initializer expression unless the variable is
/// marked with a `late` or `external` modifier.
///
/// @description Check that it is not an error if a top level or static variable
/// with a non-nullable type has no initializer expression but is marked with an
/// `external `modifier. Test `FutureOr<A>` where `A` is some class.
/// @author sgrekhov22@gmail.com

// Requirements=nnbd-strong

import "dart:async";

class A {}

external FutureOr<A> x1;

class C {
external static FutureOr<A> x1;
external static final FutureOr<A> x2;
}

main() {
new C();
}
Loading
Loading