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

Static-access-shorthand/non_ambiguity_A01_t02 - Unexpected error in test #3086

Closed
kallentu opened this issue Feb 25, 2025 · 0 comments
Closed
Assignees
Labels
bad-test Report tests in need of updates. When closed, the tests should be considered good

Comments

@kallentu
Copy link
Member

I ran into this while testing the dot shorthands CFE implementation for static gets.

It seems that the non_ambiguity_A01_t02 has the error: Error: A value of type 'Object' can't be assigned to a variable of type 'C'. which I believe is due to e2.

I tried testing the same code on without a shorthand and I get the same error.

// No shorthand, still errors.
class C {
  int value;
  C(this.value);
  static C id = C(0);
}

extension on bool {
  int get id => 42;
}

main() {
  bool e1 = 2 > 1; // true
  var e2 = "value";
  Object o = <C>{C(1)};
  if (o is Set<C>) {
    o = {e1? C.id: e2};  // Error: A value of type 'Object' can't be assigned to a variable of type 'C'.
  }
}

Could we fix the test so that we don't have that error? Thanks!

cc. @sgrekhov @eernstg

@kallentu kallentu added the bad-test Report tests in need of updates. When closed, the tests should be considered good label Feb 25, 2025
@kallentu kallentu changed the title Static-access-shorthand/non_ambiguity_A01_t02 - Not compiling even without dot shorthand? Static-access-shorthand/non_ambiguity_A01_t02 - Unexpected error in test Feb 25, 2025
@sgrekhov sgrekhov self-assigned this Mar 3, 2025
sgrekhov added a commit to sgrekhov/co19 that referenced this issue Mar 3, 2025
@eernstg eernstg closed this as completed in 6e5ee6b Mar 3, 2025
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Mar 7, 2025
2025-03-06 [email protected] dart-lang/co19#3057. Add reachability tests for operators. Part 3. (dart-lang/co19#3100)
2025-03-06 [email protected] dart-lang/co19#3057. Add reachability tests for operators. Part 2. (dart-lang/co19#3099)
2025-03-06 [email protected] dart-lang/co19#3057. Add reachability tests for operators. Part 1. (dart-lang/co19#3098)
2025-03-05 [email protected] dart-lang/co19#3057. Add reachability tests for operator + (dart-lang/co19#3097)
2025-03-05 [email protected] dart-lang/co19#3057. Add tests for cascade method invocation (dart-lang/co19#3095)
2025-03-05 [email protected] Closes dart-lang/co19#3088. Remove weak mode from LanguageFeatures/Patterns. (dart-lang/co19#3096)
2025-03-05 [email protected] dart-lang/co19#3088. Remove weak mode from LanguageFeatures/nnbd. Part 2. (dart-lang/co19#3094)
2025-03-04 [email protected] dart-lang/co19#3057. Add tests for method invocation (dart-lang/co19#3083)
2025-03-04 [email protected] dart-lang/co19#3088. Remove weak mode from LanguageFeatures/nnbd. Part 1. (dart-lang/co19#3092)
2025-03-04 [email protected] dart-lang/co19#3088. Remove weak mode from Language and LibTest (dart-lang/co19#3093)
2025-03-03 [email protected] dart-lang/co19#3088. Remove weak mode from TypeSystem/subtyping (dart-lang/co19#3091)
2025-03-03 [email protected] dart-lang/co19#3088. Remove weak mode from TypeSystem/type-normalization (dart-lang/co19#3089)
2025-03-03 [email protected] dart-lang/co19#3088. Remove weak mode from TypeSystem/flow-analysis (dart-lang/co19#3090)
2025-03-03 [email protected] Fixes dart-lang/co19#3086. Update context type for expected value (dart-lang/co19#3087)

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try
Change-Id: Ib3b8714c4d6ae5d73089b41374ed3ce16b6ddab0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414220
Reviewed-by: Erik Ernst <[email protected]>
Reviewed-by: Alexander Thomas <[email protected]>
Commit-Queue: Alexander Thomas <[email protected]>
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

2 participants