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/Augmentation-libraries/augmented_expression_A01_t09 #2661

Closed
scheglov opened this issue May 13, 2024 · 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

It looks that A is defined twice.

Other errors in augmented_expression_A01_t09_lib.dart are because the analyzer does not do implicit call() invocation yet.

unexpected analysis errors in augmented_expression_A01_t09.dart:
- Line 51, column 7: COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
  The name 'A' is already defined.

- Line 70, column 32: COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
  1 positional argument expected by 'A.new', but 0 found.

unexpected analysis errors in augmented_expression_A01_t09_lib.dart:
- Line 22, column 43: COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION
  The expression doesn't evaluate to a function, so it can't be invoked.
@scheglov
Copy link
Author

Ah, actually there are other type issues in the augmentation.

augment class C {
  augment static String get staticGetter {
    Expect.equals("A(C.staticGetter).call", augmented());
    var f = () {
      return augmented();
    };
    Expect.equals("A(C.staticGetter).call", f());
    return A("Augmented");
  }

Note that we return A from String get staticGetter.

unexpected analysis errors in augmented_expression_A01_t09_lib.dart:
- Line 37, column 12: COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
  A value of type 'A' can't be returned from the function 'staticGetter' because it has a return type of 'String'.

- Line 45, column 12: COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
  A value of type 'A' can't be returned from the function 'instanceGetter' because it has a return type of 'String'.

- Line 56, column 12: COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
  A value of type 'A' can't be returned from the function 'staticGetter' because it has a return type of 'String'.

- Line 64, column 12: COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
  A value of type 'A' can't be returned from the function 'instanceGetter' because it has a return type of 'String'.

- Line 77, column 12: COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
  A value of type 'A' can't be returned from the function 'staticGetter' because it has a return type of 'String'.

- Line 85, column 12: COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
  A value of type 'A' can't be returned from the function 'instanceGetter' because it has a return type of 'String'.

- Line 96, column 12: COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
  A value of type 'A' can't be returned from the function 'staticGetter' because it has a return type of 'String'.

- Line 104, column 12: COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
  A value of type 'A' can't be returned from the function 'instanceGetter' because it has a return type of 'String'.

@sgrekhov sgrekhov self-assigned this May 14, 2024
@sgrekhov sgrekhov added the bad-test Report tests in need of updates. When closed, the tests should be considered good label May 14, 2024
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue May 17, 2024
2024-05-16 sgrekhov22@gmail.com dart-lang/co19#2641. Rename `unchanged` -> `other_declarations` (dart-lang/co19#2670)
2024-05-16 sgrekhov22@gmail.com dart-lang/co19#2641. Check that it is still an error to declare more than one class member named `_` (dart-lang/co19#2669)
2024-05-15 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for multiple top-level declarations named `_` (dart-lang/co19#2667)
2024-05-15 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for unchanged type declarations named `_` (dart-lang/co19#2666)
2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for unchanged declarations named `_` (dart-lang/co19#2665)
2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for multiple declarations named `_` (dart-lang/co19#2656)
2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2661. Fix numerous typos in augmented_expression_A01_t09 (dart-lang/co19#2664)
2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2659. Make unique extension members names in augmenting_types_A05_t04 (dart-lang/co19#2662)
2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2660. Fix typos in augmented_expression_A01_t05 (dart-lang/co19#2663)
2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add wildcard initializer tests (dart-lang/co19#2658)
2024-05-13 sgrekhov22@gmail.com dart-lang/co19#2119. Remove some accidental comments (dart-lang/co19#2657)

Change-Id: I665f56c1039b14354019a32b94183f6d9c9bc5c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367020
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
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

2 participants