Skip to content

Commit 3e0ca13

Browse files
lrhnCommit Queue
authored and
Commit Queue
committed
Update documentation on Record and identical.
Smaller clean-ups. CoreLibraryReviewExempt: Documentation only. Change-Id: Idfe543f18927043ae8ec73e81dc7d9d333bb88df Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294542 Reviewed-by: Erik Ernst <[email protected]> Commit-Queue: Lasse Nielsen <[email protected]>
1 parent be6c105 commit 3e0ca13

16 files changed

+288
-27
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
* `RegExpMatch`
8484
* `StackTrace`
8585
* `StringSink`
86+
8687
None of these declarations contained any implementation to inherit,
8788
and are marked as `interface` to signify that they are only intended
8889
as interfaces.
@@ -93,6 +94,7 @@
9394
* `Expando`
9495
* `WeakReference`
9596
* `Finalizer`
97+
9698
The `MapEntry` value class is restricted to enable later optimizations.
9799
The remaining classes are tightly coupled to the platform and not
98100
intended to be subclassed or implemented.

pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.expect

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ library /*isNonNullableByDefault*/;
5858
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:16: Error: 'RR' is restricted and can't be extended or implemented.
5959
// abstract class C2 with RR {} // Error.
6060
// ^
61-
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
62-
// abstract final class Record {}
61+
// sdk/lib/core/record.dart:82:22: Context: This is the type denoted by the type alias.
62+
// abstract final class Record {
6363
// ^
6464
//
6565
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:24: Error: The class 'Record' can't be used as a mixin because it isn't a mixin class nor a mixin.
@@ -128,6 +128,10 @@ abstract final class _C1&Object&Record = core::Object with core::Record /*isAnon
128128
const synthetic constructor •() → self::_C1&Object&Record
129129
: super core::Object::•()
130130
;
131+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
132+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
133+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
134+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
131135
}
132136
abstract class C1 extends self::_C1&Object&Record {
133137
synthetic constructor •() → self::C1
@@ -138,6 +142,10 @@ abstract final class _C2&Object&RR = core::Object with core::Record /*isAnonymou
138142
const synthetic constructor •() → self::_C2&Object&RR
139143
: super core::Object::•()
140144
;
145+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
146+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
147+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
148+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
141149
}
142150
abstract class C2 extends self::_C2&Object&RR {
143151
synthetic constructor •() → self::C2

pkg/front_end/testcases/records/type_record_as_supertype.dart.strong.transformed.expect

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ library /*isNonNullableByDefault*/;
5858
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:16: Error: 'RR' is restricted and can't be extended or implemented.
5959
// abstract class C2 with RR {} // Error.
6060
// ^
61-
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
62-
// abstract final class Record {}
61+
// sdk/lib/core/record.dart:82:22: Context: This is the type denoted by the type alias.
62+
// abstract final class Record {
6363
// ^
6464
//
6565
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:24: Error: The class 'Record' can't be used as a mixin because it isn't a mixin class nor a mixin.
@@ -128,6 +128,10 @@ abstract final class _C1&Object&Record extends core::Object implements core::Rec
128128
const synthetic constructor •() → self::_C1&Object&Record
129129
: super core::Object::•()
130130
;
131+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ runtimeType() → core::Type;
132+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ hashCode() → core::int;
133+
abstract operator /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ ==(core::Object other) → core::bool;
134+
abstract method /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ toString() → core::String;
131135
}
132136
abstract class C1 extends self::_C1&Object&Record {
133137
synthetic constructor •() → self::C1
@@ -138,6 +142,10 @@ abstract final class _C2&Object&RR extends core::Object implements core::Record
138142
const synthetic constructor •() → self::_C2&Object&RR
139143
: super core::Object::•()
140144
;
145+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ runtimeType() → core::Type;
146+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ hashCode() → core::int;
147+
abstract operator /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ ==(core::Object other) → core::bool;
148+
abstract method /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ toString() → core::String;
141149
}
142150
abstract class C2 extends self::_C2&Object&RR {
143151
synthetic constructor •() → self::C2

pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.expect

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ library /*isNonNullableByDefault*/;
5858
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:16: Error: 'RR' is restricted and can't be extended or implemented.
5959
// abstract class C2 with RR {} // Error.
6060
// ^
61-
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
62-
// abstract final class Record {}
61+
// sdk/lib/core/record.dart:82:22: Context: This is the type denoted by the type alias.
62+
// abstract final class Record {
6363
// ^
6464
//
6565
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:24: Error: The class 'Record' can't be used as a mixin because it isn't a mixin class nor a mixin.
@@ -128,6 +128,10 @@ abstract final class _C1&Object&Record = core::Object with core::Record /*isAnon
128128
const synthetic constructor •() → self::_C1&Object&Record
129129
: super core::Object::•()
130130
;
131+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
132+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
133+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
134+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
131135
}
132136
abstract class C1 extends self::_C1&Object&Record {
133137
synthetic constructor •() → self::C1
@@ -138,6 +142,10 @@ abstract final class _C2&Object&RR = core::Object with core::Record /*isAnonymou
138142
const synthetic constructor •() → self::_C2&Object&RR
139143
: super core::Object::•()
140144
;
145+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
146+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
147+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
148+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
141149
}
142150
abstract class C2 extends self::_C2&Object&RR {
143151
synthetic constructor •() → self::C2

pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.modular.expect

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ library /*isNonNullableByDefault*/;
5858
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:16: Error: 'RR' is restricted and can't be extended or implemented.
5959
// abstract class C2 with RR {} // Error.
6060
// ^
61-
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
62-
// abstract final class Record {}
61+
// sdk/lib/core/record.dart:82:22: Context: This is the type denoted by the type alias.
62+
// abstract final class Record {
6363
// ^
6464
//
6565
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:24: Error: The class 'Record' can't be used as a mixin because it isn't a mixin class nor a mixin.
@@ -128,6 +128,10 @@ abstract final class _C1&Object&Record = core::Object with core::Record /*isAnon
128128
const synthetic constructor •() → self::_C1&Object&Record
129129
: super core::Object::•()
130130
;
131+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
132+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
133+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
134+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
131135
}
132136
abstract class C1 extends self::_C1&Object&Record {
133137
synthetic constructor •() → self::C1
@@ -138,6 +142,10 @@ abstract final class _C2&Object&RR = core::Object with core::Record /*isAnonymou
138142
const synthetic constructor •() → self::_C2&Object&RR
139143
: super core::Object::•()
140144
;
145+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
146+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
147+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
148+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
141149
}
142150
abstract class C2 extends self::_C2&Object&RR {
143151
synthetic constructor •() → self::C2

pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.outline.expect

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ library /*isNonNullableByDefault*/;
5858
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:16: Error: 'RR' is restricted and can't be extended or implemented.
5959
// abstract class C2 with RR {} // Error.
6060
// ^
61-
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
62-
// abstract final class Record {}
61+
// sdk/lib/core/record.dart:82:22: Context: This is the type denoted by the type alias.
62+
// abstract final class Record {
6363
// ^
6464
//
6565
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:24: Error: The class 'Record' can't be used as a mixin because it isn't a mixin class nor a mixin.
@@ -119,6 +119,10 @@ abstract final class _C1&Object&Record = core::Object with core::Record /*isAnon
119119
const synthetic constructor •() → self::_C1&Object&Record
120120
: super core::Object::•()
121121
;
122+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
123+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
124+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
125+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
122126
}
123127
abstract class C1 extends self::_C1&Object&Record {
124128
synthetic constructor •() → self::C1
@@ -128,6 +132,10 @@ abstract final class _C2&Object&RR = core::Object with core::Record /*isAnonymou
128132
const synthetic constructor •() → self::_C2&Object&RR
129133
: super core::Object::•()
130134
;
135+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
136+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
137+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
138+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
131139
}
132140
abstract class C2 extends self::_C2&Object&RR {
133141
synthetic constructor •() → self::C2

pkg/front_end/testcases/records/type_record_as_supertype.dart.weak.transformed.expect

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ library /*isNonNullableByDefault*/;
5858
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:16: Error: 'RR' is restricted and can't be extended or implemented.
5959
// abstract class C2 with RR {} // Error.
6060
// ^
61-
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
62-
// abstract final class Record {}
61+
// sdk/lib/core/record.dart:82:22: Context: This is the type denoted by the type alias.
62+
// abstract final class Record {
6363
// ^
6464
//
6565
// pkg/front_end/testcases/records/type_record_as_supertype.dart:29:24: Error: The class 'Record' can't be used as a mixin because it isn't a mixin class nor a mixin.
@@ -128,6 +128,10 @@ abstract final class _C1&Object&Record extends core::Object implements core::Rec
128128
const synthetic constructor •() → self::_C1&Object&Record
129129
: super core::Object::•()
130130
;
131+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ runtimeType() → core::Type;
132+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ hashCode() → core::int;
133+
abstract operator /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ ==(core::Object other) → core::bool;
134+
abstract method /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ toString() → core::String;
131135
}
132136
abstract class C1 extends self::_C1&Object&Record {
133137
synthetic constructor •() → self::C1
@@ -138,6 +142,10 @@ abstract final class _C2&Object&RR extends core::Object implements core::Record
138142
const synthetic constructor •() → self::_C2&Object&RR
139143
: super core::Object::•()
140144
;
145+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ runtimeType() → core::Type;
146+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ hashCode() → core::int;
147+
abstract operator /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ ==(core::Object other) → core::bool;
148+
abstract method /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ toString() → core::String;
141149
}
142150
abstract class C2 extends self::_C2&Object&RR {
143151
synthetic constructor •() → self::C2

pkg/front_end/testcases/records/type_record_unsupported.dart.strong.expect

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ abstract final class _A3&Object&Record = core::Object with core::Record /*isAnon
6262
const synthetic constructor •() → self::_A3&Object&Record
6363
: super core::Object::•()
6464
;
65+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
66+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
67+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
68+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
6569
}
6670
abstract class A3 extends self::_A3&Object&Record {
6771
synthetic constructor •() → self::A3

pkg/front_end/testcases/records/type_record_unsupported.dart.strong.transformed.expect

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ abstract final class _A3&Object&Record extends core::Object implements core::Rec
6262
const synthetic constructor •() → self::_A3&Object&Record
6363
: super core::Object::•()
6464
;
65+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ runtimeType() → core::Type;
66+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ hashCode() → core::int;
67+
abstract operator /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ ==(core::Object other) → core::bool;
68+
abstract method /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ toString() → core::String;
6569
}
6670
abstract class A3 extends self::_A3&Object&Record {
6771
synthetic constructor •() → self::A3

pkg/front_end/testcases/records/type_record_unsupported.dart.weak.expect

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ abstract final class _A3&Object&Record = core::Object with core::Record /*isAnon
6262
const synthetic constructor •() → self::_A3&Object&Record
6363
: super core::Object::•()
6464
;
65+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
66+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
67+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
68+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
6569
}
6670
abstract class A3 extends self::_A3&Object&Record {
6771
synthetic constructor •() → self::A3

pkg/front_end/testcases/records/type_record_unsupported.dart.weak.modular.expect

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ abstract final class _A3&Object&Record = core::Object with core::Record /*isAnon
6262
const synthetic constructor •() → self::_A3&Object&Record
6363
: super core::Object::•()
6464
;
65+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
66+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
67+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
68+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
6569
}
6670
abstract class A3 extends self::_A3&Object&Record {
6771
synthetic constructor •() → self::A3

pkg/front_end/testcases/records/type_record_unsupported.dart.weak.outline.expect

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ abstract final class _A3&Object&Record = core::Object with core::Record /*isAnon
5252
const synthetic constructor •() → self::_A3&Object&Record
5353
: super core::Object::•()
5454
;
55+
abstract mixin-stub get runtimeType() → core::Type; -> core::Record::runtimeType
56+
abstract mixin-stub get hashCode() → core::int; -> core::Record::hashCode
57+
abstract mixin-stub operator ==(core::Object other) → core::bool; -> core::Record::==
58+
abstract mixin-stub method toString() → core::String; -> core::Record::toString
5559
}
5660
abstract class A3 extends self::_A3&Object&Record {
5761
synthetic constructor •() → self::A3

pkg/front_end/testcases/records/type_record_unsupported.dart.weak.transformed.expect

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ abstract final class _A3&Object&Record extends core::Object implements core::Rec
6262
const synthetic constructor •() → self::_A3&Object&Record
6363
: super core::Object::•()
6464
;
65+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ runtimeType() → core::Type;
66+
abstract get /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ hashCode() → core::int;
67+
abstract operator /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ ==(core::Object other) → core::bool;
68+
abstract method /* from org-dartlang-sdk:///sdk/lib/core/record.dart */ toString() → core::String;
6569
}
6670
abstract class A3 extends self::_A3&Object&Record {
6771
synthetic constructor •() → self::A3

sdk/lib/core/function.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
part of dart.core;
66

7-
/// The supertype of all function types.
7+
/// A function value.
88
///
9-
/// The run-time type of a function object is a function type,
10-
/// and as such, a subtype of [Function].
9+
/// The `Function` class is a supertype of all *function types*, and contains
10+
/// no values itself. All objects that implement `Function`
11+
/// have a function type as their runtime type.
1112
///
1213
/// The `Function` type does not carry information about the
1314
/// parameter signatures or return type of a function.
@@ -89,7 +90,7 @@ part of dart.core;
8990
/// Like every function type has a `call` method with its own function type,
9091
/// the `Function` type has a special `call` member
9192
/// which acts as if it is a method with a function type of `Function`
92-
/// (which is not a method signature which can be expression in normal
93+
/// (which is not a method signature which can be expressed in normal
9394
/// Dart code).
9495
/// ```dart
9596
/// Function fun = (int x) => "$x";

0 commit comments

Comments
 (0)