mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:30:17 +00:00
[cfe] Add first portion of tests for constructor tearoffs feature
Change-Id: I868849ce96d2bfcbc05e7afc131a9fe43a83949c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201261 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
26f50368d2
commit
f81de15da7
|
@ -0,0 +1 @@
|
|||
--enable-experiment=constructor-tearoffs
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
class A<X> {
|
||||
A.foo1(X x) {}
|
||||
A.foo2(X x, int y) {}
|
||||
}
|
||||
|
||||
A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,30 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:10:33: Error: Getter not found: 'foo1'.
|
||||
// A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:11:33: Error: Getter not found: 'foo2'.
|
||||
// A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
// ^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo1(self::A::X% x) → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
constructor foo2(self::A::X% x, core::int y) → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:10:33: Error: Getter not found: 'foo1'.
|
||||
A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} <X extends core::Object? = dynamic>(X%) → self::A<X%>;
|
||||
static method bar2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:11:33: Error: Getter not found: 'foo2'.
|
||||
A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} <X extends core::Object? = dynamic>(X%) → self::A<X%>;
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,30 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:10:33: Error: Getter not found: 'foo1'.
|
||||
// A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:11:33: Error: Getter not found: 'foo2'.
|
||||
// A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
// ^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo1(self::A::X% x) → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
constructor foo2(self::A::X% x, core::int y) → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:10:33: Error: Getter not found: 'foo1'.
|
||||
A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
^^^^";
|
||||
static method bar2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:11:33: Error: Getter not found: 'foo2'.
|
||||
A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
^^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,8 @@
|
|||
class A<X> {
|
||||
A.foo1(X x) {}
|
||||
A.foo2(X x, int y) {}
|
||||
}
|
||||
|
||||
A<X> Function<X>(X) bar1() => A.foo1;
|
||||
A<X> Function<X>(X) bar2() => A.foo2;
|
||||
main() {}
|
|
@ -0,0 +1,9 @@
|
|||
A<X> Function<X>(X) bar1() => A.foo1;
|
||||
A<X> Function<X>(X) bar2() => A.foo2;
|
||||
|
||||
class A<X> {
|
||||
A.foo1(X x) {}
|
||||
A.foo2(X x, int y) {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,30 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:10:33: Error: Getter not found: 'foo1'.
|
||||
// A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:11:33: Error: Getter not found: 'foo2'.
|
||||
// A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
// ^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo1(self::A::X% x) → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
constructor foo2(self::A::X% x, core::int y) → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:10:33: Error: Getter not found: 'foo1'.
|
||||
A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} <X extends core::Object? = dynamic>(X%) → self::A<X%>;
|
||||
static method bar2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:11:33: Error: Getter not found: 'foo2'.
|
||||
A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} <X extends core::Object? = dynamic>(X%) → self::A<X%>;
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,16 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo1(self::A::X% x) → self::A<self::A::X%>
|
||||
;
|
||||
constructor foo2(self::A::X% x, core::int y) → self::A<self::A::X%>
|
||||
;
|
||||
}
|
||||
static method bar1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
;
|
||||
static method bar2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,30 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:10:33: Error: Getter not found: 'foo1'.
|
||||
// A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:11:33: Error: Getter not found: 'foo2'.
|
||||
// A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
// ^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo1(self::A::X% x) → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
constructor foo2(self::A::X% x, core::int y) → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:10:33: Error: Getter not found: 'foo1'.
|
||||
A<X> Function<X>(X) bar1() => A.foo1; // Ok.
|
||||
^^^^";
|
||||
static method bar2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:11:33: Error: Getter not found: 'foo2'.
|
||||
A<X> Function<X>(X) bar2() => A.foo2; // Error.
|
||||
^^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
class A<X> {
|
||||
A.foo() {}
|
||||
}
|
||||
|
||||
bar() => A.foo;
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
// bar() => A.foo;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo() → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar() → dynamic
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
bar() => A.foo;
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
// bar() => A.foo;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo() → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar() → dynamic
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
bar() => A.foo;
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,6 @@
|
|||
class A<X> {
|
||||
A.foo() {}
|
||||
}
|
||||
|
||||
bar() => A.foo;
|
||||
main() {}
|
|
@ -0,0 +1,7 @@
|
|||
bar() => A.foo;
|
||||
|
||||
class A<X> {
|
||||
A.foo() {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
// bar() => A.foo;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo() → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar() → dynamic
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
bar() => A.foo;
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,12 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo() → self::A<self::A::X%>
|
||||
;
|
||||
}
|
||||
static method bar() → dynamic
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
// bar() => A.foo;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::Object? = dynamic> extends core::Object {
|
||||
constructor foo() → self::A<self::A::X%>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar() → dynamic
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
bar() => A.foo;
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
class A<X extends num> {
|
||||
A.foo(X x) {}
|
||||
}
|
||||
|
||||
A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,36 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:9:34: Error: Getter not found: 'foo'.
|
||||
// A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:10:34: Error: Getter not found: 'foo'.
|
||||
// A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:11:41: Error: Getter not found: 'foo'.
|
||||
// A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::num> extends core::Object {
|
||||
constructor foo(self::A::X x) → self::A<self::A::X>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → (core::num) → self::A<core::num>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:9:34: Error: Getter not found: 'foo'.
|
||||
A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} (core::num) → self::A<core::num>;
|
||||
static method bar2() → (core::int) → self::A<core::int>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:10:34: Error: Getter not found: 'foo'.
|
||||
A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} (core::int) → self::A<core::int>;
|
||||
static method bar3() → (core::String) → self::A<dynamic>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:11:41: Error: Getter not found: 'foo'.
|
||||
A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} (core::String) → self::A<dynamic>;
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,36 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:9:34: Error: Getter not found: 'foo'.
|
||||
// A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:10:34: Error: Getter not found: 'foo'.
|
||||
// A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:11:41: Error: Getter not found: 'foo'.
|
||||
// A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::num> extends core::Object {
|
||||
constructor foo(self::A::X x) → self::A<self::A::X>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → (core::num) → self::A<core::num>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:9:34: Error: Getter not found: 'foo'.
|
||||
A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
^^^";
|
||||
static method bar2() → (core::int) → self::A<core::int>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:10:34: Error: Getter not found: 'foo'.
|
||||
A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
^^^";
|
||||
static method bar3() → (core::String) → self::A<dynamic>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:11:41: Error: Getter not found: 'foo'.
|
||||
A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,8 @@
|
|||
class A<X extends num> {
|
||||
A.foo(X x) {}
|
||||
}
|
||||
|
||||
A<num> Function(num) bar1() => A.foo;
|
||||
A<int> Function(int) bar2() => A.foo;
|
||||
A<dynamic> Function(String) bar3() => A.foo;
|
||||
main() {}
|
|
@ -0,0 +1,9 @@
|
|||
A<dynamic> Function(String) bar3() => A.foo;
|
||||
A<int> Function(int) bar2() => A.foo;
|
||||
A<num> Function(num) bar1() => A.foo;
|
||||
|
||||
class A<X extends num> {
|
||||
A.foo(X x) {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,36 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:9:34: Error: Getter not found: 'foo'.
|
||||
// A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:10:34: Error: Getter not found: 'foo'.
|
||||
// A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:11:41: Error: Getter not found: 'foo'.
|
||||
// A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::num> extends core::Object {
|
||||
constructor foo(self::A::X x) → self::A<self::A::X>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → (core::num) → self::A<core::num>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:9:34: Error: Getter not found: 'foo'.
|
||||
A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} (core::num) → self::A<core::num>;
|
||||
static method bar2() → (core::int) → self::A<core::int>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:10:34: Error: Getter not found: 'foo'.
|
||||
A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} (core::int) → self::A<core::int>;
|
||||
static method bar3() → (core::String) → self::A<dynamic>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:11:41: Error: Getter not found: 'foo'.
|
||||
A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} (core::String) → self::A<dynamic>;
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,16 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::num> extends core::Object {
|
||||
constructor foo(self::A::X x) → self::A<self::A::X>
|
||||
;
|
||||
}
|
||||
static method bar1() → (core::num) → self::A<core::num>
|
||||
;
|
||||
static method bar2() → (core::int) → self::A<core::int>
|
||||
;
|
||||
static method bar3() → (core::String) → self::A<dynamic>
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,36 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:9:34: Error: Getter not found: 'foo'.
|
||||
// A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:10:34: Error: Getter not found: 'foo'.
|
||||
// A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:11:41: Error: Getter not found: 'foo'.
|
||||
// A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A<X extends core::num> extends core::Object {
|
||||
constructor foo(self::A::X x) → self::A<self::A::X>
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → (core::num) → self::A<core::num>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:9:34: Error: Getter not found: 'foo'.
|
||||
A<num> Function(num) bar1() => A.foo; // Ok.
|
||||
^^^";
|
||||
static method bar2() → (core::int) → self::A<core::int>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:10:34: Error: Getter not found: 'foo'.
|
||||
A<int> Function(int) bar2() => A.foo; // Ok.
|
||||
^^^";
|
||||
static method bar3() → (core::String) → self::A<dynamic>
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:11:41: Error: Getter not found: 'foo'.
|
||||
A<dynamic> Function(String) bar3() => A.foo; // Error.
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
class A {
|
||||
A.foo1() {}
|
||||
A.foo2(int x) {}
|
||||
}
|
||||
|
||||
A Function() bar1() => A.foo1; // Ok.
|
||||
A Function() bar2() => A.foo2; // Error.
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,30 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:10:26: Error: Getter not found: 'foo1'.
|
||||
// A Function() bar1() => A.foo1; // Ok.
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:11:26: Error: Getter not found: 'foo2'.
|
||||
// A Function() bar2() => A.foo2; // Error.
|
||||
// ^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo1() → self::A
|
||||
: super core::Object::•() {}
|
||||
constructor foo2(core::int x) → self::A
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → () → self::A
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:10:26: Error: Getter not found: 'foo1'.
|
||||
A Function() bar1() => A.foo1; // Ok.
|
||||
^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} () → self::A;
|
||||
static method bar2() → () → self::A
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:11:26: Error: Getter not found: 'foo2'.
|
||||
A Function() bar2() => A.foo2; // Error.
|
||||
^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} () → self::A;
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,30 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:10:26: Error: Getter not found: 'foo1'.
|
||||
// A Function() bar1() => A.foo1; // Ok.
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:11:26: Error: Getter not found: 'foo2'.
|
||||
// A Function() bar2() => A.foo2; // Error.
|
||||
// ^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo1() → self::A
|
||||
: super core::Object::•() {}
|
||||
constructor foo2(core::int x) → self::A
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → () → self::A
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:10:26: Error: Getter not found: 'foo1'.
|
||||
A Function() bar1() => A.foo1; // Ok.
|
||||
^^^^";
|
||||
static method bar2() → () → self::A
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:11:26: Error: Getter not found: 'foo2'.
|
||||
A Function() bar2() => A.foo2; // Error.
|
||||
^^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,8 @@
|
|||
class A {
|
||||
A.foo1() {}
|
||||
A.foo2(int x) {}
|
||||
}
|
||||
|
||||
A Function() bar1() => A.foo1;
|
||||
A Function() bar2() => A.foo2;
|
||||
main() {}
|
|
@ -0,0 +1,9 @@
|
|||
A Function() bar1() => A.foo1;
|
||||
A Function() bar2() => A.foo2;
|
||||
|
||||
class A {
|
||||
A.foo1() {}
|
||||
A.foo2(int x) {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,30 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:10:26: Error: Getter not found: 'foo1'.
|
||||
// A Function() bar1() => A.foo1; // Ok.
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:11:26: Error: Getter not found: 'foo2'.
|
||||
// A Function() bar2() => A.foo2; // Error.
|
||||
// ^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo1() → self::A
|
||||
: super core::Object::•() {}
|
||||
constructor foo2(core::int x) → self::A
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → () → self::A
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:10:26: Error: Getter not found: 'foo1'.
|
||||
A Function() bar1() => A.foo1; // Ok.
|
||||
^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} () → self::A;
|
||||
static method bar2() → () → self::A
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:11:26: Error: Getter not found: 'foo2'.
|
||||
A Function() bar2() => A.foo2; // Error.
|
||||
^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} () → self::A;
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,16 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo1() → self::A
|
||||
;
|
||||
constructor foo2(core::int x) → self::A
|
||||
;
|
||||
}
|
||||
static method bar1() → () → self::A
|
||||
;
|
||||
static method bar2() → () → self::A
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,30 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:10:26: Error: Getter not found: 'foo1'.
|
||||
// A Function() bar1() => A.foo1; // Ok.
|
||||
// ^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:11:26: Error: Getter not found: 'foo2'.
|
||||
// A Function() bar2() => A.foo2; // Error.
|
||||
// ^^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo1() → self::A
|
||||
: super core::Object::•() {}
|
||||
constructor foo2(core::int x) → self::A
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar1() → () → self::A
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:10:26: Error: Getter not found: 'foo1'.
|
||||
A Function() bar1() => A.foo1; // Ok.
|
||||
^^^^";
|
||||
static method bar2() → () → self::A
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:11:26: Error: Getter not found: 'foo2'.
|
||||
A Function() bar2() => A.foo2; // Error.
|
||||
^^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
class A {
|
||||
A.foo() {}
|
||||
}
|
||||
|
||||
bar() => A.foo;
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
// bar() => A.foo;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo() → self::A
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar() → dynamic
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
bar() => A.foo;
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
// bar() => A.foo;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo() → self::A
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar() → dynamic
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
bar() => A.foo;
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,6 @@
|
|||
class A {
|
||||
A.foo() {}
|
||||
}
|
||||
|
||||
bar() => A.foo;
|
||||
main() {}
|
|
@ -0,0 +1,7 @@
|
|||
bar() => A.foo;
|
||||
|
||||
class A {
|
||||
A.foo() {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
// bar() => A.foo;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo() → self::A
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar() → dynamic
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
bar() => A.foo;
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,12 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo() → self::A
|
||||
;
|
||||
}
|
||||
static method bar() → dynamic
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
// bar() => A.foo;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class A extends core::Object {
|
||||
constructor foo() → self::A
|
||||
: super core::Object::•() {}
|
||||
}
|
||||
static method bar() → dynamic
|
||||
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:9:12: Error: Getter not found: 'foo'.
|
||||
bar() => A.foo;
|
||||
^^^";
|
||||
static method main() → dynamic {}
|
Loading…
Reference in a new issue