// Copyright (c) 2019, 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.

// SharedOptions=--enable-experiment=nonfunction-type-aliases

// Introduce an aliased type.

typedef T = Object;

// Use the aliased type.

abstract class C {
  T? v10;
  final T v12;
  C(): v12 = T();
  C.name1(this.v10, this.v12);
  factory C.name2(T arg1, T arg2) = C.name1;
}

abstract class D2 extends C with T {}
//             ^
// [analyzer] unspecified
// [cfe] unspecified

abstract class D3 implements T {}
//             ^
// [analyzer] unspecified
// [cfe] unspecified

abstract class D4 = C with T;
//             ^
// [analyzer] unspecified
// [cfe] unspecified

main() {
  T.named();
//  ^^^^^
// [analyzer] unspecified
// [cfe] unspecified

  T.staticMethod<T>();
//  ^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] Method not found: 'Object.staticMethod'.
//  ^^^^^^^^^^^^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
}

// Copyright (c) 2019, 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.

// SharedOptions=--enable-experiment=nonfunction-type-aliases

// Introduce an aliased type.

typedef T = Object;

// Use the aliased type.

abstract class C {
  T? v10;
  final T v12;
  C(): v12 = T();
  C.name1(this.v10, this.v12);
  factory C.name2(T arg1, T arg2) = C1.name1;
}

class C1 implements C {
  C1.name1(T arg1, T arg2);
  noSuchMethod(Invocation invocation) => throw 0;
}

abstract class D2 extends C with T {}
//             ^
// [analyzer] unspecified
// [cfe] unspecified

abstract class D3 implements T {}
//             ^
// [analyzer] unspecified
// [cfe] unspecified

abstract class D4 = C with T;
//             ^
// [analyzer] unspecified
// [cfe] unspecified

main() {
  T.named();
//  ^^^^^
// [analyzer] unspecified
// [cfe] unspecified

  T.staticMethod<T>();
//  ^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] Method not found: 'Object.staticMethod'.
//  ^^^^^^^^^^^^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
}

Fix one more test with factory redirect to abstract class.
Fix one more test with factory redirect to abstract class.

Same as https://dart-review.googlesource.com/c/sdk/+/175361

Change-Id: I0f6b9032e4f2718bceb00010080bc5ca0835a761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175580
Reviewed-by: Brian Wilkerson <1f7641b6b14c52b9163524ab8d9aabff80176f21@google.com>
Reviewed-by: Erik Ernst <251bb01623bfda2cd9151e339a6e783ca432874c@google.com>
Commit-Queue: Konstantin Shcheglov <09e4d7516628963212bf4aace2f97603d2b706e4@google.com>
