forked from flutter/engine
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Ia7dc56774599a17d4a29d03ec8ec07cb01995fdb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137300 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
- Loading branch information
1 parent
6262e8f
commit 4189237
Showing
8 changed files
with
208 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2020, 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. | ||
|
||
class GenericNever<T extends Never> { | ||
dynamic getParamType() => T; | ||
} | ||
|
||
errors() { | ||
GenericNever<Null>(); | ||
GenericNever<void>(); | ||
GenericNever<int>(); | ||
} | ||
|
||
main() {} |
14 changes: 14 additions & 0 deletions
14
pkg/front_end/testcases/nnbd/never_bound.dart.outline.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class GenericNever<T extends Never = Never> extends core::Object { | ||
synthetic constructor •() → self::GenericNever<self::GenericNever::T> | ||
; | ||
method getParamType() → dynamic | ||
; | ||
} | ||
static method errors() → dynamic | ||
; | ||
static method main() → dynamic | ||
; |
44 changes: 44 additions & 0 deletions
44
pkg/front_end/testcases/nnbd/never_bound.dart.strong.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:10:3: Error: Type argument 'Null?' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<Null>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:11:3: Error: Type argument 'void' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<void>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:12:3: Error: Type argument 'int' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<int>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class GenericNever<T extends Never = Never> extends core::Object { | ||
synthetic constructor •() → self::GenericNever<self::GenericNever::T> | ||
: super core::Object::•() | ||
; | ||
method getParamType() → dynamic | ||
return self::GenericNever::T; | ||
} | ||
static method errors() → dynamic { | ||
new self::GenericNever::•<core::Null?>(); | ||
new self::GenericNever::•<void>(); | ||
new self::GenericNever::•<core::int>(); | ||
} | ||
static method main() → dynamic {} |
44 changes: 44 additions & 0 deletions
44
pkg/front_end/testcases/nnbd/never_bound.dart.strong.transformed.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:10:3: Error: Type argument 'Null?' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<Null>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:11:3: Error: Type argument 'void' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<void>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:12:3: Error: Type argument 'int' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<int>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class GenericNever<T extends Never = Never> extends core::Object { | ||
synthetic constructor •() → self::GenericNever<self::GenericNever::T> | ||
: super core::Object::•() | ||
; | ||
method getParamType() → dynamic | ||
return self::GenericNever::T; | ||
} | ||
static method errors() → dynamic { | ||
new self::GenericNever::•<core::Null?>(); | ||
new self::GenericNever::•<void>(); | ||
new self::GenericNever::•<core::int>(); | ||
} | ||
static method main() → dynamic {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:10:3: Error: Type argument 'Null?' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<Null>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:11:3: Error: Type argument 'void' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<void>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:12:3: Error: Type argument 'int' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<int>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class GenericNever<T extends Never = Never> extends core::Object { | ||
synthetic constructor •() → self::GenericNever<self::GenericNever::T> | ||
: super core::Object::•() | ||
; | ||
method getParamType() → dynamic | ||
return self::GenericNever::T; | ||
} | ||
static method errors() → dynamic { | ||
new self::GenericNever::•<core::Null?>(); | ||
new self::GenericNever::•<void>(); | ||
new self::GenericNever::•<core::int>(); | ||
} | ||
static method main() → dynamic {} |
44 changes: 44 additions & 0 deletions
44
pkg/front_end/testcases/nnbd/never_bound.dart.weak.transformed.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:10:3: Error: Type argument 'Null?' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<Null>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:11:3: Error: Type argument 'void' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<void>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:12:3: Error: Type argument 'int' doesn't conform to the bound 'Never' of the type variable 'T' on 'GenericNever'. | ||
// Try changing type arguments so that they conform to the bounds. | ||
// GenericNever<int>(); | ||
// ^ | ||
// pkg/front_end/testcases/nnbd/never_bound.dart:5:20: Context: This is the type variable whose bound isn't conformed to. | ||
// class GenericNever<T extends Never> { | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class GenericNever<T extends Never = Never> extends core::Object { | ||
synthetic constructor •() → self::GenericNever<self::GenericNever::T> | ||
: super core::Object::•() | ||
; | ||
method getParamType() → dynamic | ||
return self::GenericNever::T; | ||
} | ||
static method errors() → dynamic { | ||
new self::GenericNever::•<core::Null?>(); | ||
new self::GenericNever::•<void>(); | ||
new self::GenericNever::•<core::int>(); | ||
} | ||
static method main() → dynamic {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters