Skip to content

Conversation

brunoalfred
Copy link

No description provided.

@marceloneppel
Copy link
Owner

Hi Bruno! That's an excellent contribution! I will check everything until Wednesday. Thanks!

@brunoalfred
Copy link
Author

Hi Bruno! That's an excellent contribution! I will check everything until Wednesday. Thanks!

Please review my PR.

@marceloneppel
Copy link
Owner

marceloneppel commented Sep 20, 2021

Hi @brunoalfred! Sorry for the delay. I will review your PR until tomorrow. I saw some errors in the master code with the CI and I'm checking a way to fix them. Did you run the dart test command? I tried locally in your branch and got some errors like the one below (I will check again tomorrow):

00:02 +0 -13: loading test/aggregation_test.dart [E]                                                                                         
  Failed to load "test/aggregation_test.dart":
  lib/src/ast.dart:28:26: Error: The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'List<dynamic>'.
   - 'Map' is from 'dart:core'.
   - 'List' is from 'dart:core'.
      invocationParams.add(options);
                           ^
  lib/src/net.dart:24:15: Error: The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'int'.
   - 'Map' is from 'dart:core'.
        res.add(optargs);
                ^

I'm fixing the CI to test there and avoid some problems related to my machine.


serialize() {
List res = [_type.value];
var res = [_type.value];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we would need something like var res = <dynamic>[_type.value]; (as mentioned in https://dart.dev/guides/language/type-system) to not throw an error in the tests like the one below:

lib/src/net.dart:24:15: Error: The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'int'.
   - 'Map' is from 'dart:core'.
        res.add(optargs);
                ^

}
List invocationParams = [argsList];
if (options.isNotEmpty) {
var invocationParams = [argsList];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we would need something like var invocationParams = <dynamic>[argsList]; (as mentioned in https://dart.dev/guides/language/type-system) to not throw an error in the tests like the one below:

lib/src/ast.dart:28:26: Error: The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'List<dynamic>'.
   - 'Map' is from 'dart:core'.
   - 'List' is from 'dart:core'.
      invocationParams.add(options);
                           ^

Copy link
Owner

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @brunoalfred! I added comments for two needed changes in the code (ast.dart and net.dat). We will also need some refactor in the code of the tests to solve the problems with the access of the late variables. Currently we are getting the following error:

dart:_internal-patch/internal_patch.dart 216:5  LateError._throwLocalNotInitialized
  test/aggregation_test.dart 17:9                 main.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart                            _CustomZone.bindUnaryCallbackGuarded.<fn>

Another error that I saw in two tests (connection_test.dart and parallel_execution_test.dart) is the following one:

type 'Future<dynamic>' is not a subtype of type 'FutureOr<Map<dynamic, dynamic>>' in type cast

  test/connection_test.dart 55:34                   main.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 199:9  Declarer.test.<fn>.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 197:7  Declarer.test.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/invoker.dart 257:7   Invoker._waitForOutstandingCallbacks.<fn>

These two errors happen after we fix the points that I commented in ast.dart and net.dart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants