Constructors should not have type parameters when resynthesize from Kernel.

Factory constructors are represented as static Procedure(s) with
type parameters. This does not match to the language specification and
Analyzer element model. We need to pretend that these type parameters
are absent, so that we pick up the same named type parameters from the
enclosing class.

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Id26cf0e9c08699ac46978e14640e01089a1efcbc
Reviewed-on: https://dart-review.googlesource.com/9080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov
2017-09-27 23:55:42 +00:00
parent f7c4667a54
commit fb02cf80ee
4 changed files with 3 additions and 85 deletions
@@ -2375,6 +2375,9 @@ class ConstructorElementImpl extends ExecutableElementImpl
@override
bool get isStatic => false;
@override
List<kernel.TypeParameter> get kernelTypeParams => const [];
@override
ElementKind get kind => ElementKind.CONSTRUCTOR;
@@ -556,18 +556,6 @@ class CompileTimeErrorCodeTest_Kernel extends CompileTimeErrorCodeTest_Driver {
return super.test_recursiveConstructorRedirect();
}
@override
@failingTest
test_recursiveFactoryRedirect_diverging() async {
return super.test_recursiveFactoryRedirect_diverging();
}
@override
@failingTest
test_recursiveFactoryRedirect_generic() async {
return super.test_recursiveFactoryRedirect_generic();
}
@override
@failingTest
test_recursiveFactoryRedirect_named() async {
@@ -29,13 +29,6 @@ class NonErrorResolverTest_Kernel extends NonErrorResolverTest_Driver {
@override
@failingTest
test_async_future_int_with_return_future_int() async {
return super.test_async_future_int_with_return_future_int();
}
@override
@failingTest
@FastaProblem('https://github.com/dart-lang/sdk/issues/30812')
test_conflictingConstructorNameAndMember_setter() async {
return super.test_conflictingConstructorNameAndMember_setter();
}
@@ -44,72 +44,6 @@ class StrongModeLocalInferenceTest_Kernel
return super.test_factoryConstructor_propagation();
}
@override
@failingTest
test_futureOr_assignFromFuture() async {
return super.test_futureOr_assignFromFuture();
}
@override
@failingTest
test_futureOr_downwards1() async {
return super.test_futureOr_downwards1();
}
@override
@failingTest
test_futureOr_downwards2() async {
return super.test_futureOr_downwards2();
}
@override
@failingTest
test_futureOr_downwards3() async {
return super.test_futureOr_downwards3();
}
@override
@failingTest
test_futureOr_downwards4() async {
return super.test_futureOr_downwards4();
}
@override
@failingTest
test_futureOr_downwards5() async {
return super.test_futureOr_downwards5();
}
@override
@failingTest
test_futureOr_downwards6() async {
return super.test_futureOr_downwards6();
}
@override
@failingTest
test_futureOr_downwards7() async {
return super.test_futureOr_downwards7();
}
@override
@failingTest
test_futureOr_downwards8() async {
return super.test_futureOr_downwards8();
}
@override
@failingTest
test_futureOr_upwards1() async {
return super.test_futureOr_upwards1();
}
@override
@failingTest
test_futureOr_upwards2() async {
return super.test_futureOr_upwards2();
}
@override
@failingTest
test_generic_partial() async {