blob: 14f18b3e4fa8fba163ad0e35a3841ed72897d346 [file] [log] [blame]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/redirecting_factory.dart:7:28: Error: The constructor function type 'Foo<Tf> Function(int)' isn't a subtype of 'FooBase<Tf> Function(int)'.
// - 'Foo' is from 'pkg/front_end/testcases/general/redirecting_factory.dart'.
// - 'FooBase' is from 'pkg/front_end/testcases/general/redirecting_factory.dart'.
// factory FooBase(int x) = Foo<Tf>;
// ^
//
import self as self;
import "dart:core" as core;
abstract class FooBase<Tf extends core::Object? = dynamic> extends core::Object {
abstract get x() core::int;
static factory •<Tf extends core::Object? = dynamic>(core::int x) self::FooBase<self::FooBase::•::Tf%>
return invalid-expression "pkg/front_end/testcases/general/redirecting_factory.dart:7:28: Error: The constructor function type 'Foo<Tf> Function(int)' isn't a subtype of 'FooBase<Tf> Function(int)'.
- 'Foo' is from 'pkg/front_end/testcases/general/redirecting_factory.dart'.
- 'FooBase' is from 'pkg/front_end/testcases/general/redirecting_factory.dart'.
factory FooBase(int x) = Foo<Tf>;
^";
}
abstract class Foo<T extends core::Object? = dynamic> extends core::Object implements self::FooBase<dynamic> {
static factory •<T extends core::Object? = dynamic>(core::int x) self::Foo<self::Foo::•::T%> /* redirection-target: self::Bar::•<core::String, self::Foo::•::T%>*/
return new self::Bar::•<core::String, self::Foo::•::T%>(x);
}
class Bar<Sb extends core::Object? = dynamic, Tb extends core::Object? = dynamic> extends core::Object implements self::Foo<self::Bar::Tb%> {
field core::int x;
constructor •(core::int x) self::Bar<self::Bar::Sb%, self::Bar::Tb%>
: self::Bar::x = x, super core::Object::•() {
core::print("Bar<${self::Bar::Sb%},${self::Bar::Tb%}>");
}
}
class Builder<X extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() self::Builder<self::Builder::X%>
: super core::Object::•()
;
method method() dynamic {
return invalid-expression "pkg/front_end/testcases/general/redirecting_factory.dart:7:28: Error: The constructor function type 'Foo<Tf> Function(int)' isn't a subtype of 'FooBase<Tf> Function(int)'.
- 'Foo' is from 'pkg/front_end/testcases/general/redirecting_factory.dart'.
- 'FooBase' is from 'pkg/front_end/testcases/general/redirecting_factory.dart'.
factory FooBase(int x) = Foo<Tf>;
^";
}
}
class SimpleCase<A extends core::Object? = dynamic, B extends core::Object? = dynamic> extends core::Object {
static factory •<A extends core::Object? = dynamic, B extends core::Object? = dynamic>() self::SimpleCase<self::SimpleCase::•::A%, self::SimpleCase::•::B%> /* redirection-target: self::SimpleCaseImpl::•<self::SimpleCase::•::A%, self::SimpleCase::•::B%>*/
return self::SimpleCaseImpl::•<self::SimpleCase::•::A%, self::SimpleCase::•::B%>();
}
class SimpleCaseImpl<Ai extends core::Object? = dynamic, Bi extends core::Object? = dynamic> extends core::Object implements self::SimpleCase<self::SimpleCaseImpl::Ai%, self::SimpleCaseImpl::Bi%> {
static factory •<Ai extends core::Object? = dynamic, Bi extends core::Object? = dynamic>() self::SimpleCaseImpl<self::SimpleCaseImpl::•::Ai%, self::SimpleCaseImpl::•::Bi%> /* redirection-target: self::SimpleCaseImpl2::•<self::SimpleCaseImpl::•::Ai%, self::SimpleCaseImpl::•::Bi%>*/
return new self::SimpleCaseImpl2::•<self::SimpleCaseImpl::•::Ai%, self::SimpleCaseImpl::•::Bi%>();
}
class SimpleCaseImpl2<Ai2 extends core::Object? = dynamic, Bi2 extends core::Object? = dynamic> extends core::Object implements self::SimpleCaseImpl<self::SimpleCaseImpl2::Ai2%, self::SimpleCaseImpl2::Bi2%> {
synthetic constructor •() self::SimpleCaseImpl2<self::SimpleCaseImpl2::Ai2%, self::SimpleCaseImpl2::Bi2%>
: super core::Object::•()
;
}
class Base<M extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() self::Base<self::Base::M%>
: super core::Object::•()
;
}
abstract class Mixin<M extends core::Object? = dynamic> extends core::Object /*isMixinDeclaration*/ {
}
class Mix<M extends core::Object? = dynamic> = self::Base<self::Mix::M%> with self::Mixin<self::Mix::M%> {
synthetic constructor •() self::Mix<self::Mix::M%>
: super self::Base::•()
;
}
static method main() dynamic {
core::print(invalid-expression "pkg/front_end/testcases/general/redirecting_factory.dart:7:28: Error: The constructor function type 'Foo<Tf> Function(int)' isn't a subtype of 'FooBase<Tf> Function(int)'.
- 'Foo' is from 'pkg/front_end/testcases/general/redirecting_factory.dart'.
- 'FooBase' is from 'pkg/front_end/testcases/general/redirecting_factory.dart'.
factory FooBase(int x) = Foo<Tf>;
^".{self::FooBase::x}{core::int});
new self::SimpleCaseImpl2::•<core::int, core::double>();
new self::Mix::•<core::double>();
}