mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 12:58:05 +00:00
[cfe] Add Jenkins SMI hashcode combiner
Change-Id: I542369fc2d8443bb0094fdedc11596fdc2f20e2d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159084 Commit-Queue: Javier López-Contreras <jlcontreras@google.com> Reviewed-by: Erik Ernst <eernst@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This commit is contained in:
parent
ee8690563d
commit
42c4c3c1bd
|
@ -335,6 +335,7 @@ issue41499b
|
|||
it'll
|
||||
italic
|
||||
iter
|
||||
jlcontreras
|
||||
joo
|
||||
jumped
|
||||
kernels
|
||||
|
|
|
@ -254,4 +254,5 @@ runtime_checks_new/mixin_forwarding_stub_getter: TypeCheckError
|
|||
runtime_checks_new/mixin_forwarding_stub_setter: TypeCheckError
|
||||
set_literals/disambiguation_rule: RuntimeError
|
||||
value_class/simple: RuntimeError # Expected
|
||||
value_class/super_type: RuntimeError # Expected
|
||||
value_class/value_extends_non_value: RuntimeError # Expected
|
||||
value_class/value_implements_non_value: RuntimeError # Expected
|
|
@ -251,5 +251,5 @@ runtime_checks_new/mixin_forwarding_stub_field: TypeCheckError
|
|||
runtime_checks_new/mixin_forwarding_stub_setter: TypeCheckError
|
||||
set_literals/disambiguation_rule: RuntimeError
|
||||
value_class/simple: RuntimeError # Expected
|
||||
value_class/super_type: RuntimeError # Expected
|
||||
|
||||
value_class/value_extends_non_value: RuntimeError # Expected
|
||||
value_class/value_implements_non_value: RuntimeError # Expected
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class EmptyClass {}
|
||||
|
|
|
@ -1,12 +1,28 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::valueClass
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
@val::valueClass
|
||||
class EmptyClass extends core::Object {
|
||||
synthetic constructor •() → self::EmptyClass
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -2,14 +2,36 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class EmptyClass extends core::Object {
|
||||
synthetic constructor •() → self::EmptyClass
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,14 +2,36 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class EmptyClass extends core::Object {
|
||||
synthetic constructor •() → self::EmptyClass
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class EmptyClass {}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class EmptyClass {}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
main() {}
|
||||
|
|
|
@ -2,14 +2,36 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class EmptyClass extends core::Object {
|
||||
synthetic constructor •() → self::EmptyClass
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,14 +2,36 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class EmptyClass extends core::Object {
|
||||
synthetic constructor •() → self::EmptyClass
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class A {}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::valueClass
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
@val::valueClass
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
;
|
||||
|
@ -25,12 +28,25 @@ class E = self::B with self::A {
|
|||
: super self::B::•()
|
||||
;
|
||||
}
|
||||
@self::valueClass
|
||||
@val::valueClass
|
||||
class F = self::B with self::C {
|
||||
synthetic constructor •() → self::F
|
||||
: super self::B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -2,6 +2,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
|
@ -32,9 +34,29 @@ class F = self::B with self::C {
|
|||
: super self::B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
|
@ -32,9 +34,29 @@ class F extends self::B implements self::C /*isEliminatedMixin*/ {
|
|||
: super self::B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class A {}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class A {}
|
||||
|
||||
|
@ -9,5 +11,4 @@ class D = A with B;
|
|||
class E = B with A;
|
||||
@valueClass
|
||||
class F = B with C;
|
||||
const String valueClass = "valueClass";
|
||||
main() {}
|
||||
|
|
|
@ -2,6 +2,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
|
@ -32,9 +34,29 @@ class F = self::B with self::C {
|
|||
: super self::B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
|
@ -32,9 +34,29 @@ class F extends self::B implements self::C /*isEliminatedMixin*/ {
|
|||
: super self::B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
|
|
@ -1,13 +1,29 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::valueClass
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
@val::valueClass
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs;
|
||||
synthetic constructor •() → self::Animal
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -9,15 +9,37 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -9,15 +9,37 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
int numberOfLegs;
|
||||
}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
main() {}
|
||||
|
|
|
@ -9,15 +9,37 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -9,15 +9,37 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::valueClass
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
@val::valueClass
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -12,6 +15,19 @@ class Cat extends self::Animal {
|
|||
synthetic constructor •() → self::Cat
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -10,6 +10,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
|
@ -21,9 +23,29 @@ class Cat extends self::Animal {
|
|||
: super self::Animal::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
|
@ -21,9 +23,29 @@ class Cat extends self::Animal {
|
|||
: super self::Animal::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
|
@ -5,5 +7,4 @@ class Animal {
|
|||
|
||||
class Cat extends Animal {}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
main() {}
|
||||
|
|
|
@ -10,6 +10,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
|
@ -21,9 +23,29 @@ class Cat extends self::Animal {
|
|||
: super self::Animal::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
|
@ -21,9 +23,29 @@ class Cat extends self::Animal {
|
|||
: super self::Animal::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::valueClass
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
@val::valueClass
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -13,6 +16,19 @@ class Cat extends core::Object implements self::Animal {
|
|||
synthetic constructor •() → self::Cat
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -15,6 +15,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
|
@ -27,9 +29,29 @@ class Cat extends core::Object implements self::Animal {
|
|||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
|
@ -27,9 +29,29 @@ class Cat extends core::Object implements self::Animal {
|
|||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
|
@ -7,5 +9,4 @@ class Cat implements Animal {
|
|||
final int numberOfLegs;
|
||||
}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
main() {}
|
||||
|
|
|
@ -15,6 +15,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
|
@ -27,9 +29,29 @@ class Cat extends core::Object implements self::Animal {
|
|||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
|
@ -27,9 +29,29 @@ class Cat extends core::Object implements self::Animal {
|
|||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
@ -21,11 +21,6 @@ main() {
|
|||
expect(false, firstAnimal.hashCode == thirdAnimal.hashCode);
|
||||
}
|
||||
|
||||
expect(expected, actual, [expectNull = false]) {
|
||||
if (expectNull) {
|
||||
expected = null;
|
||||
}
|
||||
if (expected != actual) {
|
||||
throw 'Mismatch: expected=$expected, actual=$actual';
|
||||
}
|
||||
expect(Object? expected, Object? actual) {
|
||||
if (expected != actual) throw 'Expected=$expected, actual=$actual';
|
||||
}
|
|
@ -1,15 +1,31 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::valueClass
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
@val::valueClass
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
synthetic constructor •() → self::Animal
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull]) → dynamic
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -31,13 +31,14 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {
|
||||
self::Animal firstAnimal = invalid-expression "pkg/front_end/testcases/value_class/simple.dart:13:31: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Animal firstAnimal = Animal(numberOfLegs: 4);
|
||||
|
@ -53,16 +54,32 @@ static method main() → dynamic {
|
|||
self::expect(true, firstAnimal.{core::Object::hashCode}.{core::num::==}(secondAnimal.{core::Object::hashCode}));
|
||||
self::expect(false, firstAnimal.{core::Object::hashCode}.{core::num::==}(thirdAnimal.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull = #C2]) → dynamic {
|
||||
if(expectNull as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
||||
expected = null;
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
if(!expected.{core::Object::==}(actual)) {
|
||||
throw "Mismatch: expected=${expected}, actual=${actual}";
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
#C2 = false
|
||||
}
|
||||
|
|
|
@ -31,13 +31,14 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {
|
||||
self::Animal firstAnimal = invalid-expression "pkg/front_end/testcases/value_class/simple.dart:13:31: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Animal firstAnimal = Animal(numberOfLegs: 4);
|
||||
|
@ -53,16 +54,32 @@ static method main() → dynamic {
|
|||
self::expect(true, firstAnimal.{core::Object::hashCode}.{core::num::==}(secondAnimal.{core::Object::hashCode}));
|
||||
self::expect(false, firstAnimal.{core::Object::hashCode}.{core::num::==}(thirdAnimal.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull = #C2]) → dynamic {
|
||||
if(expectNull as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
||||
expected = null;
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
if(!expected.{core::Object::==}(actual)) {
|
||||
throw "Mismatch: expected=${expected}, actual=${actual}";
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
#C2 = false
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
@ -6,4 +6,4 @@ class Animal {
|
|||
}
|
||||
|
||||
main() {}
|
||||
expect(expected, actual, [expectNull = false]) {}
|
||||
expect(Object? expected, Object? actual) {}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
expect(expected, actual, [expectNull = false]) {}
|
||||
expect(Object? expected, Object? actual) {}
|
||||
main() {}
|
||||
|
|
|
@ -31,13 +31,14 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {
|
||||
self::Animal firstAnimal = invalid-expression "pkg/front_end/testcases/value_class/simple.dart:13:31: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Animal firstAnimal = Animal(numberOfLegs: 4);
|
||||
|
@ -53,16 +54,32 @@ static method main() → dynamic {
|
|||
self::expect(true, firstAnimal.{core::Object::hashCode}.{core::num::==}(secondAnimal.{core::Object::hashCode}));
|
||||
self::expect(false, firstAnimal.{core::Object::hashCode}.{core::num::==}(thirdAnimal.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull = #C2]) → dynamic {
|
||||
if(expectNull as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
||||
expected = null;
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
if(!expected.{core::Object::==}(actual)) {
|
||||
throw "Mismatch: expected=${expected}, actual=${actual}";
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
#C2 = false
|
||||
}
|
||||
|
|
|
@ -31,13 +31,14 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {
|
||||
self::Animal firstAnimal = invalid-expression "pkg/front_end/testcases/value_class/simple.dart:13:31: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Animal firstAnimal = Animal(numberOfLegs: 4);
|
||||
|
@ -53,16 +54,32 @@ static method main() → dynamic {
|
|||
self::expect(true, firstAnimal.{core::Object::hashCode}.{core::num::==}(secondAnimal.{core::Object::hashCode}));
|
||||
self::expect(false, firstAnimal.{core::Object::hashCode}.{core::num::==}(thirdAnimal.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull = #C2]) → dynamic {
|
||||
if(expectNull as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
||||
expected = null;
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
if(!expected.{core::Object::==}(actual)) {
|
||||
throw "Mismatch: expected=${expected}, actual=${actual}";
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
#C2 = false
|
||||
}
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
}
|
||||
|
||||
@valueClass
|
||||
class Cat implements Animal {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
main() {
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
|
||||
expect(true, firstCat == secondCat);
|
||||
expect(false, firstCat == thirdCat);
|
||||
|
||||
expect(true, firstCat.hashCode == secondCat.hashCode);
|
||||
expect(false, firstCat.hashCode == thirdCat.hashCode);
|
||||
}
|
||||
|
||||
expect(expected, actual, [expectNull = false]) {
|
||||
if (expectNull) {
|
||||
expected = null;
|
||||
}
|
||||
if (expected != actual) {
|
||||
throw 'Mismatch: expected=$expected, actual=$actual';
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::valueClass
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
synthetic constructor •() → self::Animal
|
||||
;
|
||||
}
|
||||
@self::valueClass
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs;
|
||||
final field core::int numberOfWhiskers;
|
||||
synthetic constructor •() → self::Cat
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull]) → dynamic
|
||||
;
|
|
@ -1,85 +0,0 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:19:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:20:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:21:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:9:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:14:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:15:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs = null;
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, self::Cat::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:19:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:20:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:21:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull = #C2]) → dynamic {
|
||||
if(expectNull as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
||||
expected = null;
|
||||
}
|
||||
if(!expected.{core::Object::==}(actual)) {
|
||||
throw "Mismatch: expected=${expected}, actual=${actual}";
|
||||
}
|
||||
}
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
#C2 = false
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:19:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:20:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:21:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:9:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:14:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:15:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs = null;
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, self::Cat::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:19:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:20:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:21:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^";
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull = #C2]) → dynamic {
|
||||
if(expectNull as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
||||
expected = null;
|
||||
}
|
||||
if(!expected.{core::Object::==}(actual)) {
|
||||
throw "Mismatch: expected=${expected}, actual=${actual}";
|
||||
}
|
||||
}
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
#C2 = false
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
const String valueClass = "valueClass";
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
}
|
||||
|
||||
@valueClass
|
||||
class Cat implements Animal {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
main() {}
|
||||
expect(expected, actual, [expectNull = false]) {}
|
|
@ -1,14 +0,0 @@
|
|||
@valueClass
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
}
|
||||
|
||||
@valueClass
|
||||
class Cat implements Animal {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
expect(expected, actual, [expectNull = false]) {}
|
||||
main() {}
|
|
@ -1,85 +0,0 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:19:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:20:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:21:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:9:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:14:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:15:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs = null;
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, self::Cat::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:19:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:20:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:21:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull = #C2]) → dynamic {
|
||||
if(expectNull as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
||||
expected = null;
|
||||
}
|
||||
if(!expected.{core::Object::==}(actual)) {
|
||||
throw "Mismatch: expected=${expected}, actual=${actual}";
|
||||
}
|
||||
}
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
#C2 = false
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:19:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:20:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:21:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:9:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:14:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/super_type.dart:15:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
: self::Animal::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs = null;
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, self::Cat::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:19:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:20:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/super_type.dart:21:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^";
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(dynamic expected, dynamic actual, [dynamic expectNull = #C2]) → dynamic {
|
||||
if(expectNull as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
||||
expected = null;
|
||||
}
|
||||
if(!expected.{core::Object::==}(actual)) {
|
||||
throw "Mismatch: expected=${expected}, actual=${actual}";
|
||||
}
|
||||
}
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
#C2 = false
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// 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.
|
||||
|
||||
// TODO(jlcontreras): this is a temp file for the valueClass experiment
|
||||
|
||||
const valueClass = "valueClass";
|
||||
|
||||
/// This code is from the dart.math sdk/lib/math/jenkins_smi_hash.dart
|
||||
class JenkinsSmiHash {
|
||||
static int combine(int hash, int value) {
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
|
@ -14,4 +14,18 @@ class Cat extends Animal {
|
|||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
main() {}
|
||||
main() {
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
|
||||
expect(true, firstCat == secondCat);
|
||||
expect(false, firstCat == thirdCat);
|
||||
|
||||
expect(true, firstCat.hashCode == secondCat.hashCode);
|
||||
expect(false, firstCat.hashCode == thirdCat.hashCode);
|
||||
}
|
||||
|
||||
expect(Object? expected, Object? actual) {
|
||||
if (expected != actual) throw 'Expected=$expected, actual=$actual';
|
||||
}
|
|
@ -1,18 +1,36 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
constructor •({required core::int numberOfLegs}) → self::Animal
|
||||
;
|
||||
}
|
||||
@self::valueClass
|
||||
@val::valueClass
|
||||
class Cat extends self::Animal {
|
||||
final field core::int numberOfWhiskers;
|
||||
synthetic constructor •() → self::Cat
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -2,6 +2,27 @@ library /*isNonNullableByDefault*/;
|
|||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:18:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:19:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:20:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:14:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
|
@ -10,6 +31,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
constructor •({required core::int numberOfLegs = #C1}) → self::Animal
|
||||
|
@ -22,8 +45,46 @@ class Cat extends self::Animal {
|
|||
: self::Cat::numberOfWhiskers = numberOfWhiskers, super self::Animal::•(numberOfLegs)
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:18:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:19:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:20:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C2;
|
||||
static method main() → dynamic {}
|
||||
|
||||
constants {
|
||||
#C1 = null
|
||||
|
|
|
@ -2,6 +2,27 @@ library /*isNonNullableByDefault*/;
|
|||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:18:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:19:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:20:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:14:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
|
@ -10,6 +31,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
constructor •({required core::int numberOfLegs = #C1}) → self::Animal
|
||||
|
@ -22,8 +45,46 @@ class Cat extends self::Animal {
|
|||
: self::Cat::numberOfWhiskers = numberOfWhiskers, super self::Animal::•(numberOfLegs)
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:18:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:19:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:20:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^";
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C2;
|
||||
static method main() → dynamic {}
|
||||
|
||||
constants {
|
||||
#C1 = null
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
|
@ -11,3 +11,4 @@ class Cat extends Animal {
|
|||
}
|
||||
|
||||
main() {}
|
||||
expect(Object? expected, Object? actual) {}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
class Animal {
|
||||
Animal({required this.numberOfLegs});
|
||||
final int numberOfLegs;
|
||||
|
@ -8,5 +10,5 @@ class Cat extends Animal {
|
|||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
expect(Object? expected, Object? actual) {}
|
||||
main() {}
|
||||
|
|
|
@ -2,6 +2,27 @@ library /*isNonNullableByDefault*/;
|
|||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:18:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:19:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:20:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:14:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
|
@ -10,6 +31,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
constructor •({required core::int numberOfLegs = #C1}) → self::Animal
|
||||
|
@ -22,8 +45,46 @@ class Cat extends self::Animal {
|
|||
: self::Cat::numberOfWhiskers = numberOfWhiskers, super self::Animal::•(numberOfLegs)
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:18:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:19:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:20:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C2;
|
||||
static method main() → dynamic {}
|
||||
|
||||
constants {
|
||||
#C1 = null
|
||||
|
|
|
@ -2,6 +2,27 @@ library /*isNonNullableByDefault*/;
|
|||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:18:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:19:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:20:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat extends Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value.dart:14:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
|
@ -10,6 +31,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
constructor •({required core::int numberOfLegs = #C1}) → self::Animal
|
||||
|
@ -22,8 +45,46 @@ class Cat extends self::Animal {
|
|||
: self::Cat::numberOfWhiskers = numberOfWhiskers, super self::Animal::•(numberOfLegs)
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:18:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:19:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/value_extends_non_value.dart:20:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^";
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C2;
|
||||
static method main() → dynamic {}
|
||||
|
||||
constants {
|
||||
#C1 = null
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
class Animal {
|
||||
int numberOfLegs;
|
||||
|
@ -11,4 +11,11 @@ class Animal {
|
|||
@valueClass
|
||||
class Cat extends Animal {}
|
||||
|
||||
class Animal2 {
|
||||
final int numberOfLegs;
|
||||
}
|
||||
|
||||
@valueClass
|
||||
class Cat2 extends Animal2 {}
|
||||
|
||||
main() {}
|
|
@ -1,17 +1,43 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs;
|
||||
synthetic constructor •() → self::Animal
|
||||
;
|
||||
}
|
||||
@self::valueClass
|
||||
@val::valueClass
|
||||
class Cat extends self::Animal {
|
||||
synthetic constructor •() → self::Cat
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
class Animal2 extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
synthetic constructor •() → self::Animal2
|
||||
;
|
||||
}
|
||||
@val::valueClass
|
||||
class Cat2 extends self::Animal2 {
|
||||
synthetic constructor •() → self::Cat2
|
||||
;
|
||||
}
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -6,9 +6,16 @@ library /*isNonNullableByDefault*/;
|
|||
// int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value_error.dart:15:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -20,9 +27,40 @@ class Cat extends self::Animal {
|
|||
: super self::Animal::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
class Animal2 extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal2
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Cat2 extends self::Animal2 {
|
||||
synthetic constructor •() → self::Cat2
|
||||
: super self::Animal2::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -6,9 +6,16 @@ library /*isNonNullableByDefault*/;
|
|||
// int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value_error.dart:15:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -20,9 +27,40 @@ class Cat extends self::Animal {
|
|||
: super self::Animal::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
class Animal2 extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal2
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Cat2 extends self::Animal2 {
|
||||
synthetic constructor •() → self::Cat2
|
||||
: super self::Animal2::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
class Animal {
|
||||
int numberOfLegs;
|
||||
|
@ -7,4 +7,11 @@ class Animal {
|
|||
@valueClass
|
||||
class Cat extends Animal {}
|
||||
|
||||
class Animal2 {
|
||||
final int numberOfLegs;
|
||||
}
|
||||
|
||||
@valueClass
|
||||
class Cat2 extends Animal2 {}
|
||||
|
||||
main() {}
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
class Animal {
|
||||
int numberOfLegs;
|
||||
}
|
||||
|
||||
class Animal2 {
|
||||
final int numberOfLegs;
|
||||
}
|
||||
|
||||
@valueClass
|
||||
class Cat extends Animal {}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
@valueClass
|
||||
class Cat2 extends Animal2 {}
|
||||
|
||||
main() {}
|
||||
|
|
|
@ -6,9 +6,16 @@ library /*isNonNullableByDefault*/;
|
|||
// int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value_error.dart:15:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -20,9 +27,40 @@ class Cat extends self::Animal {
|
|||
: super self::Animal::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
class Animal2 extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal2
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Cat2 extends self::Animal2 {
|
||||
synthetic constructor •() → self::Cat2
|
||||
: super self::Animal2::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -6,9 +6,16 @@ library /*isNonNullableByDefault*/;
|
|||
// int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_extends_non_value_error.dart:15:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -20,9 +27,40 @@ class Cat extends self::Animal {
|
|||
: super self::Animal::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
class Animal2 extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal2
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Cat2 extends self::Animal2 {
|
||||
synthetic constructor •() → self::Cat2
|
||||
: super self::Animal2::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import '../nnbd_mixed/nnbd_opt_out_language_version.dart';
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
|
@ -11,6 +12,42 @@ class Animal {
|
|||
@valueClass
|
||||
class Cat implements Animal {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
main() {}
|
||||
abstract class Animal2 {
|
||||
int get numberOfLegs;
|
||||
}
|
||||
|
||||
@valueClass
|
||||
class Cat2 implements Animal2 {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
|
||||
expect(true, firstCat == secondCat);
|
||||
expect(false, firstCat == thirdCat);
|
||||
|
||||
expect(true, firstCat.hashCode == secondCat.hashCode);
|
||||
expect(false, firstCat.hashCode == thirdCat.hashCode);
|
||||
|
||||
Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
|
||||
expect(true, firstCat2 == secondCat2);
|
||||
expect(false, firstCat2 == thirdCat2);
|
||||
|
||||
expect(true, firstCat2.hashCode == secondCat2.hashCode);
|
||||
expect(false, firstCat2.hashCode == thirdCat2.hashCode);
|
||||
}
|
||||
|
||||
expect(Object? expected, Object? actual) {
|
||||
if (expected != actual) throw 'Expected=$expected, actual=$actual';
|
||||
}
|
|
@ -1,18 +1,82 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
|
||||
import "org-dartlang-testcase-sdk:///pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart";
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs;
|
||||
synthetic constructor •() → self::Animal
|
||||
;
|
||||
}
|
||||
@self::valueClass
|
||||
@val::valueClass
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs;
|
||||
final field core::int numberOfWhiskers;
|
||||
synthetic constructor •() → self::Cat
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
abstract class Animal2 extends core::Object {
|
||||
synthetic constructor •() → self::Animal2
|
||||
;
|
||||
abstract get numberOfLegs() → core::int;
|
||||
}
|
||||
@val::valueClass
|
||||
class Cat2 extends core::Object implements self::Animal2 {
|
||||
final field core::int numberOfLegs;
|
||||
final field core::int numberOfWhiskers;
|
||||
synthetic constructor •() → self::Cat2
|
||||
;
|
||||
}
|
||||
static method main() → dynamic
|
||||
;
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:1:1: Error: A library can't opt out of null safety by default, when using sound null safety.
|
||||
// // @dart=2.4
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class late extends core::Object {
|
||||
synthetic constructor •() → self2::late
|
||||
;
|
||||
get g() → core::int
|
||||
;
|
||||
}
|
||||
class required extends core::Object {
|
||||
synthetic constructor •() → self2::required
|
||||
;
|
||||
get g() → core::int
|
||||
;
|
||||
}
|
||||
class C extends core::Object {
|
||||
field self2::late l;
|
||||
field self2::required r;
|
||||
synthetic constructor •() → self2::C
|
||||
;
|
||||
}
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -2,19 +2,79 @@ library /*isNonNullableByDefault*/;
|
|||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:8:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:30:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:31:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:32:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:40:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:41:26: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:42:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:9:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:14:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:15:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:24:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:25:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase-sdk:///pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart";
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -23,12 +83,139 @@ class Animal extends core::Object {
|
|||
}
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, self::Cat::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
abstract class Animal2 extends core::Object {
|
||||
synthetic constructor •() → self::Animal2
|
||||
: super core::Object::•()
|
||||
;
|
||||
abstract get numberOfLegs() → core::int;
|
||||
}
|
||||
class Cat2 extends core::Object implements self::Animal2 {
|
||||
final field core::int numberOfLegs = null;
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat2
|
||||
: self::Cat2::numberOfLegs = numberOfLegs, self::Cat2::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:30:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:31:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:32:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
self::Cat2 firstCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:40:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat2;
|
||||
self::Cat2 secondCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:41:26: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat2;
|
||||
self::Cat2 thirdCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:42:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat2;
|
||||
self::expect(true, firstCat2.{core::Object::==}(secondCat2));
|
||||
self::expect(false, firstCat2.{core::Object::==}(thirdCat2));
|
||||
self::expect(true, firstCat2.{core::Object::hashCode}.{core::num::==}(secondCat2.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat2.{core::Object::hashCode}.{core::num::==}(thirdCat2.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:1:1: Error: A library can't opt out of null safety by default, when using sound null safety.
|
||||
// // @dart=2.4
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:3:7: Error: Can't use 'late' as a name here.
|
||||
// class late {
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:7:7: Error: Can't use 'required' as a name here.
|
||||
// class required {
|
||||
// ^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:12:8: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
||||
// Try adding the name of the type of the variable or the keyword 'var'.
|
||||
// late l = late();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:13:3: Error: Can't have modifier 'required' here.
|
||||
// Try removing 'required'.
|
||||
// required r = required();
|
||||
// ^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:13:12: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
||||
// Try adding the name of the type of the variable or the keyword 'var'.
|
||||
// required r = required();
|
||||
// ^
|
||||
//
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class late extends core::Object {
|
||||
synthetic constructor •() → self2::late
|
||||
: super core::Object::•()
|
||||
;
|
||||
get g() → core::int
|
||||
return 1;
|
||||
}
|
||||
class required extends core::Object {
|
||||
synthetic constructor •() → self2::required
|
||||
: super core::Object::•()
|
||||
;
|
||||
get g() → core::int
|
||||
return 2;
|
||||
}
|
||||
class C extends core::Object {
|
||||
field self2::late l = new self2::late::•();
|
||||
field self2::required r = new self2::required::•();
|
||||
synthetic constructor •() → self2::C
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
if(!new self2::C::•().{self2::C::l}.{self2::late::g}.{core::num::==}(1))
|
||||
throw "Expected 1";
|
||||
if(!new self2::C::•().{self2::C::r}.{self2::required::g}.{core::num::==}(2))
|
||||
throw "Expected 2";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self3;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self3::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
|
|
|
@ -2,19 +2,79 @@ library /*isNonNullableByDefault*/;
|
|||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:8:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:30:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:31:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:32:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:40:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:41:26: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:42:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:9:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:14:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:15:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:24:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:25:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase-sdk:///pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart";
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -23,12 +83,139 @@ class Animal extends core::Object {
|
|||
}
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, self::Cat::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
abstract class Animal2 extends core::Object {
|
||||
synthetic constructor •() → self::Animal2
|
||||
: super core::Object::•()
|
||||
;
|
||||
abstract get numberOfLegs() → core::int;
|
||||
}
|
||||
class Cat2 extends core::Object implements self::Animal2 {
|
||||
final field core::int numberOfLegs = null;
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat2
|
||||
: self::Cat2::numberOfLegs = numberOfLegs, self::Cat2::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:30:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:31:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:32:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^";
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
self::Cat2 firstCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:40:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat2 secondCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:41:26: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat2 thirdCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:42:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^";
|
||||
self::expect(true, firstCat2.{core::Object::==}(secondCat2));
|
||||
self::expect(false, firstCat2.{core::Object::==}(thirdCat2));
|
||||
self::expect(true, firstCat2.{core::Object::hashCode}.{core::num::==}(secondCat2.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat2.{core::Object::hashCode}.{core::num::==}(thirdCat2.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:1:1: Error: A library can't opt out of null safety by default, when using sound null safety.
|
||||
// // @dart=2.4
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:3:7: Error: Can't use 'late' as a name here.
|
||||
// class late {
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:7:7: Error: Can't use 'required' as a name here.
|
||||
// class required {
|
||||
// ^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:12:8: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
||||
// Try adding the name of the type of the variable or the keyword 'var'.
|
||||
// late l = late();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:13:3: Error: Can't have modifier 'required' here.
|
||||
// Try removing 'required'.
|
||||
// required r = required();
|
||||
// ^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart:13:12: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
|
||||
// Try adding the name of the type of the variable or the keyword 'var'.
|
||||
// required r = required();
|
||||
// ^
|
||||
//
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class late extends core::Object {
|
||||
synthetic constructor •() → self2::late
|
||||
: super core::Object::•()
|
||||
;
|
||||
get g() → core::int
|
||||
return 1;
|
||||
}
|
||||
class required extends core::Object {
|
||||
synthetic constructor •() → self2::required
|
||||
: super core::Object::•()
|
||||
;
|
||||
get g() → core::int
|
||||
return 2;
|
||||
}
|
||||
class C extends core::Object {
|
||||
field self2::late l = new self2::late::•();
|
||||
field self2::required r = new self2::required::•();
|
||||
synthetic constructor •() → self2::C
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
if(!new self2::C::•().{self2::C::l}.{self2::late::g}.{core::num::==}(1))
|
||||
throw "Expected 1";
|
||||
if(!new self2::C::•().{self2::C::r}.{self2::required::g}.{core::num::==}(2))
|
||||
throw "Expected 2";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self3;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self3::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const String valueClass = "valueClass";
|
||||
import '../nnbd_mixed/nnbd_opt_out_language_version.dart';
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
|
@ -7,6 +8,18 @@ class Animal {
|
|||
@valueClass
|
||||
class Cat implements Animal {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
abstract class Animal2 {
|
||||
int get numberOfLegs;
|
||||
}
|
||||
|
||||
@valueClass
|
||||
class Cat2 implements Animal2 {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
main() {}
|
||||
expect(Object? expected, Object? actual) {}
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
import '../nnbd_mixed/nnbd_opt_out_language_version.dart';
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
abstract class Animal2 {
|
||||
int get numberOfLegs;
|
||||
}
|
||||
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
}
|
||||
|
@ -5,7 +12,14 @@ class Animal {
|
|||
@valueClass
|
||||
class Cat implements Animal {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
@valueClass
|
||||
class Cat2 implements Animal2 {
|
||||
final int numberOfLegs;
|
||||
final int numberOfWhiskers;
|
||||
}
|
||||
|
||||
expect(Object? expected, Object? actual) {}
|
||||
main() {}
|
||||
|
|
|
@ -2,19 +2,79 @@ library /*isNonNullableByDefault*/;
|
|||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:8:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:30:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:31:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:32:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:40:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:41:26: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:42:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:9:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:14:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:15:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:24:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:25:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase-sdk:///pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart";
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -23,12 +83,139 @@ class Animal extends core::Object {
|
|||
}
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, self::Cat::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
abstract class Animal2 extends core::Object {
|
||||
synthetic constructor •() → self::Animal2
|
||||
: super core::Object::•()
|
||||
;
|
||||
abstract get numberOfLegs() → core::int;
|
||||
}
|
||||
class Cat2 extends core::Object implements self::Animal2 {
|
||||
final field core::int numberOfLegs = null;
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat2
|
||||
: self::Cat2::numberOfLegs = numberOfLegs, self::Cat2::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:30:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:31:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:32:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat;
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
self::Cat2 firstCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:40:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat2;
|
||||
self::Cat2 secondCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:41:26: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat2;
|
||||
self::Cat2 thirdCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:42:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::Cat2;
|
||||
self::expect(true, firstCat2.{core::Object::==}(secondCat2));
|
||||
self::expect(false, firstCat2.{core::Object::==}(thirdCat2));
|
||||
self::expect(true, firstCat2.{core::Object::hashCode}.{core::num::==}(secondCat2.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat2.{core::Object::hashCode}.{core::num::==}(thirdCat2.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class late extends core::Object {
|
||||
synthetic constructor •() → self2::late*
|
||||
: super core::Object::•()
|
||||
;
|
||||
get g() → core::int*
|
||||
return 1;
|
||||
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
||||
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
||||
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
||||
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
||||
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
||||
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
||||
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
||||
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
||||
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
||||
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
||||
}
|
||||
class required extends core::Object {
|
||||
synthetic constructor •() → self2::required*
|
||||
: super core::Object::•()
|
||||
;
|
||||
get g() → core::int*
|
||||
return 2;
|
||||
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
||||
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
||||
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
||||
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
||||
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
||||
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
||||
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
||||
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
||||
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
||||
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
||||
}
|
||||
class C extends core::Object {
|
||||
field self2::late* l = new self2::late::•();
|
||||
field self2::required* r = new self2::required::•();
|
||||
synthetic constructor •() → self2::C*
|
||||
: super core::Object::•()
|
||||
;
|
||||
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
||||
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
||||
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
||||
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
||||
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
||||
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
||||
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
||||
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
||||
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
||||
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
||||
}
|
||||
static method main() → dynamic {
|
||||
if(!new self2::C::•().{self2::C::l}.{self2::late::g}.{core::num::==}(1))
|
||||
throw "Expected 1";
|
||||
if(!new self2::C::•().{self2::C::r}.{self2::required::g}.{core::num::==}(2))
|
||||
throw "Expected 2";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self3;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self3::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
|
|
|
@ -2,19 +2,79 @@ library /*isNonNullableByDefault*/;
|
|||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:8:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:30:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:31:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:32:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:7: Context: The class 'Cat' has a constructor that takes no arguments.
|
||||
// class Cat implements Animal {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:40:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:41:26: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:42:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
// Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
// ^^^^^^^^^^^^
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:23:7: Context: The class 'Cat2' has a constructor that takes no arguments.
|
||||
// class Cat2 implements Animal2 {
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:9:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:13:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:14:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:15:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:24:13: Error: Final field 'numberOfLegs' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfLegs;
|
||||
// ^^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/value_class/value_implements_non_value.dart:25:13: Error: Final field 'numberOfWhiskers' is not initialized.
|
||||
// Try to initialize the field in the declaration or in every constructor.
|
||||
// final int numberOfWhiskers;
|
||||
// ^^^^^^^^^^^^^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase-sdk:///pkg/front_end/testcases/nnbd_mixed/nnbd_opt_out_language_version.dart";
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class Animal extends core::Object {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •() → self::Animal
|
||||
|
@ -23,12 +83,139 @@ class Animal extends core::Object {
|
|||
}
|
||||
class Cat extends core::Object implements self::Animal {
|
||||
final field core::int numberOfLegs = null;
|
||||
synthetic constructor •({required core::int numberOfLegs}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, super core::Object::•()
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat
|
||||
: self::Cat::numberOfLegs = numberOfLegs, self::Cat::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
abstract class Animal2 extends core::Object {
|
||||
synthetic constructor •() → self::Animal2
|
||||
: super core::Object::•()
|
||||
;
|
||||
abstract get numberOfLegs() → core::int;
|
||||
}
|
||||
class Cat2 extends core::Object implements self::Animal2 {
|
||||
final field core::int numberOfLegs = null;
|
||||
final field core::int numberOfWhiskers = null;
|
||||
synthetic constructor •({required core::int numberOfLegs, required core::int numberOfWhiskers}) → self::Cat2
|
||||
: self::Cat2::numberOfLegs = numberOfLegs, self::Cat2::numberOfWhiskers = numberOfWhiskers, super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method main() → dynamic {
|
||||
self::Cat firstCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:30:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat firstCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat secondCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:31:23: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat secondCat = Cat(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat thirdCat = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:32:22: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat thirdCat = Cat(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^";
|
||||
self::expect(true, firstCat.{core::Object::==}(secondCat));
|
||||
self::expect(false, firstCat.{core::Object::==}(thirdCat));
|
||||
self::expect(true, firstCat.{core::Object::hashCode}.{core::num::==}(secondCat.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat.{core::Object::hashCode}.{core::num::==}(thirdCat.{core::Object::hashCode}));
|
||||
self::Cat2 firstCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:40:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 firstCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat2 secondCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:41:26: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 secondCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 10);
|
||||
^^^^^^^^^^^^";
|
||||
self::Cat2 thirdCat2 = invalid-expression "pkg/front_end/testcases/value_class/value_implements_non_value.dart:42:25: Error: No named parameter with the name 'numberOfLegs'.
|
||||
Cat2 thirdCat2 = Cat2(numberOfLegs: 4, numberOfWhiskers: 0);
|
||||
^^^^^^^^^^^^";
|
||||
self::expect(true, firstCat2.{core::Object::==}(secondCat2));
|
||||
self::expect(false, firstCat2.{core::Object::==}(thirdCat2));
|
||||
self::expect(true, firstCat2.{core::Object::hashCode}.{core::num::==}(secondCat2.{core::Object::hashCode}));
|
||||
self::expect(false, firstCat2.{core::Object::hashCode}.{core::num::==}(thirdCat2.{core::Object::hashCode}));
|
||||
}
|
||||
static method expect(core::Object? expected, core::Object? actual) → dynamic {
|
||||
if(!expected.{core::Object::==}(actual))
|
||||
throw "Expected=${expected}, actual=${actual}";
|
||||
}
|
||||
|
||||
library;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class late extends core::Object {
|
||||
synthetic constructor •() → self2::late*
|
||||
: super core::Object::•()
|
||||
;
|
||||
get g() → core::int*
|
||||
return 1;
|
||||
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
||||
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
||||
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
||||
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
||||
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
||||
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
||||
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
||||
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
||||
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
||||
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
||||
}
|
||||
class required extends core::Object {
|
||||
synthetic constructor •() → self2::required*
|
||||
: super core::Object::•()
|
||||
;
|
||||
get g() → core::int*
|
||||
return 2;
|
||||
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
||||
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
||||
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
||||
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
||||
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
||||
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
||||
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
||||
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
||||
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
||||
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
||||
}
|
||||
class C extends core::Object {
|
||||
field self2::late* l = new self2::late::•();
|
||||
field self2::required* r = new self2::required::•();
|
||||
synthetic constructor •() → self2::C*
|
||||
: super core::Object::•()
|
||||
;
|
||||
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
||||
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
||||
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
||||
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
||||
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
||||
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
||||
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
||||
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
||||
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
||||
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
||||
}
|
||||
static method main() → dynamic {
|
||||
if(!new self2::C::•().{self2::C::l}.{self2::late::g}.{core::num::==}(1))
|
||||
throw "Expected 1";
|
||||
if(!new self2::C::•().{self2::C::r}.{self2::required::g}.{core::num::==}(2))
|
||||
throw "Expected 2";
|
||||
}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self3;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self3::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class A {}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "value_class_support_lib.dart" as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::valueClass
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
@val::valueClass
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
;
|
||||
|
@ -29,6 +32,19 @@ class D extends self::_D&A&B {
|
|||
synthetic constructor •() → self::D
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as val;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → val::JenkinsSmiHash
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int
|
||||
;
|
||||
static method finish(core::int hash) → core::int
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = "valueClass";
|
||||
|
|
|
@ -2,6 +2,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
|
@ -32,9 +34,29 @@ class D extends self::_D&A&B {
|
|||
: super self::_D&A&B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
|
@ -32,9 +34,29 @@ class D extends self::_D&A&B {
|
|||
: super self::_D&A&B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class A {}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class A {}
|
||||
|
||||
|
@ -7,5 +9,4 @@ class C extends B with A {}
|
|||
|
||||
class D extends A with B {}
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
main() {}
|
||||
|
|
|
@ -2,6 +2,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
|
@ -32,9 +34,29 @@ class D extends self::_D&A&B {
|
|||
: super self::_D&A&B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ library /*isNonNullableByDefault*/;
|
|||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
import "org-dartlang-testcase:///value_class_support_lib.dart";
|
||||
|
||||
class A extends core::Object {
|
||||
synthetic constructor •() → self::A
|
||||
: super core::Object::•()
|
||||
|
@ -32,9 +34,29 @@ class D extends self::_D&A&B {
|
|||
: super self::_D&A&B::•()
|
||||
;
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
static method main() → dynamic {}
|
||||
|
||||
library /*isNonNullableByDefault*/;
|
||||
import self as self2;
|
||||
import "dart:core" as core;
|
||||
|
||||
class JenkinsSmiHash extends core::Object {
|
||||
synthetic constructor •() → self2::JenkinsSmiHash
|
||||
: super core::Object::•()
|
||||
;
|
||||
static method combine(core::int hash, core::int value) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(value));
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(524287.{core::int::&}(hash).{core::int::<<}(10)));
|
||||
return hash.{core::int::^}(hash.{core::int::>>}(6));
|
||||
}
|
||||
static method finish(core::int hash) → core::int {
|
||||
hash = 536870911.{core::int::&}(hash.{core::num::+}(67108863.{core::int::&}(hash).{core::int::<<}(3)));
|
||||
hash = hash.{core::int::^}(hash.{core::int::>>}(11));
|
||||
return 536870911.{core::int::&}(hash.{core::num::+}(16383.{core::int::&}(hash).{core::int::<<}(15)));
|
||||
}
|
||||
}
|
||||
static const field core::String valueClass = #C1;
|
||||
|
||||
constants {
|
||||
#C1 = "valueClass"
|
||||
}
|
||||
|
|
|
@ -73,5 +73,5 @@ nnbd_mixed/messages_with_types_opt_in: TypeCheckError
|
|||
nnbd_mixed/messages_with_types_opt_out: TypeCheckError
|
||||
nnbd_mixed/never_opt_out: TypeCheckError
|
||||
value_class/simple: RuntimeError # Expected
|
||||
value_class/super_type: RuntimeError # Expected
|
||||
|
||||
value_class/value_extends_non_value: RuntimeError # Expected
|
||||
value_class/value_implements_non_value: RuntimeError # Expected
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// A value class will automatically create an empty constructor if there is none yet
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
|
|
@ -5,11 +5,10 @@
|
|||
// Equals operator == by value should be implicitly created
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
// A value class will automatically create an == operator if there is none yet
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
final int numberOfLegs;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// It is a compile-time error if a value class has a non-final instance variable.
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// Value classes are always leaves in the tree of types
|
||||
|
||||
const String valueClass = "valueClass";
|
||||
import 'value_class_support_lib.dart';
|
||||
|
||||
@valueClass
|
||||
class Animal {}
|
||||
|
|
21
tests/language/value_class/value_class_support_lib.dart
Normal file
21
tests/language/value_class/value_class_support_lib.dart
Normal file
|
@ -0,0 +1,21 @@
|
|||
// 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.
|
||||
|
||||
// TODO(jlcontreras): this is a temp file for the valueClass experiment
|
||||
const valueClass = "valueClass";
|
||||
|
||||
/// This code is from the dart.math sdk/lib/math/jenkins_smi_hash.dart
|
||||
class JenkinsSmiHash {
|
||||
static int combine(int hash, int value) {
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue