Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

co19/LanguageFeatures/Extension-types/static_analysis_extension_types_A24_t02 #2245

Closed
scheglov opened this issue Aug 29, 2023 · 1 comment
Closed
Assignees
Labels
bad-test Report tests in need of updates. When closed, the tests should be considered good

Comments

@scheglov
Copy link

extension type const ET2<T>(int id) {
  const ET2.c1() : this(0);
<cut>

  ET2.c1.expectStaticType<Exactly<ET2<dynamic> Function()>>();

Why is it ET2<dynamic> Function()?

For classes we keep constructor of generic classes uninstantiated.

class A<T> {
  A.named() {
    print('T: $T');
  }
}

main() {
  const x = A.named;
  x<int>();
  x<double>();
}

This code prints

T: int
T: double

@eernstg

@sgrekhov sgrekhov self-assigned this Aug 30, 2023
@sgrekhov sgrekhov added the bad-test Report tests in need of updates. When closed, the tests should be considered good label Aug 30, 2023
sgrekhov added a commit to sgrekhov/co19 that referenced this issue Aug 30, 2023
@eernstg
Copy link
Member

eernstg commented Aug 30, 2023

Agreed, it should be ET2.c1.expectStaticType<Exactly<ET2<X> Function<X>()>>();, cf. this rule (except that the return type of name$tearoff should be C<typeArgs> rather than a plain C).

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Sep 4, 2023
2023-09-04 sgrekhov22@gmail.com dart-lang/co19#2145. Fix roll failure (LateInitializationError) (dart-lang/co19#2257)
2023-09-04 sgrekhov22@gmail.com dart-lang/co19#2145. Add more local variable declaration tests (dart-lang/co19#2254)
2023-09-01 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 3.5.3 to 3.6.0 (dart-lang/co19#2256)
2023-09-01 sgrekhov22@gmail.com dart-lang/co19#2213. Fix stack trace comparison (dart-lang/co19#2255)
2023-09-01 sgrekhov22@gmail.com dart-lang/co19#2145. Update variables tests according to the current spec. Part 2 (dart-lang/co19#2240)
2023-08-31 sgrekhov22@gmail.com dart-lang/co19#2242. Add LFCR line ending test (dart-lang/co19#2251)
2023-08-31 sgrekhov22@gmail.com dart-lang/co19#2145. Rename Local Variable declaration tests. Delete duplicates (dart-lang/co19#2252)
2023-08-30 sgrekhov22@gmail.com dart-lang/co19#2242. Add line endings tests (dart-lang/co19#2250)
2023-08-30 sgrekhov22@gmail.com Fixes dart-lang/co19#2245. Fix expectations in static_analysis_extension_types_A24_t02.dart (dart-lang/co19#2248)
2023-08-30 sgrekhov22@gmail.com dart-lang/co19#2242. Change CRLF line endings to LF (dart-lang/co19#2249)
2023-08-30 sgrekhov22@gmail.com Fixes dart-lang/co19#2244. Fix typo in dynamic_semantics_member_invocation_A01_t02.dart (dart-lang/co19#2247)
2023-08-30 sgrekhov22@gmail.com Fixes dart-lang/co19#2243. Remove duplicated constructors (dart-lang/co19#2246)
2023-08-29 sgrekhov22@gmail.com dart-lang/co19#2145. Update assertions and descriptions in the current Local variable declaration tests (dart-lang/co19#2241)
2023-08-25 sgrekhov22@gmail.com Fixes dart-lang/co19#2235. Add missing operator tests (dart-lang/co19#2239)
2023-08-25 sgrekhov22@gmail.com dart-lang/co19#2119. Code format and description update in operator tests (dart-lang/co19#2238)

Change-Id: I5aeac05c1aa4cbaa0762ce4f23c1ee916d1006a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324040
Reviewed-by: Alexander Thomas <athom@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bad-test Report tests in need of updates. When closed, the tests should be considered good
Projects
None yet
Development

No branches or pull requests

3 participants