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

"Type 'void' not found" returned from CFE when using void as a type parameter to a mixin #35194

Open
ds84182 opened this issue Nov 16, 2018 · 0 comments
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues.

Comments

@ds84182
Copy link
Contributor

ds84182 commented Nov 16, 2018

Dart version: Dart VM version: 2.1.0-dev.9.4 (Unknown timestamp) on "linux_x64"

Error message: lib/snakeway/snakeway.dart:1: Error: Type 'void' not found.

mixin _Batch<I, V, T, B> {
  final Map<I, B> _batch = {};
  bool _scheduled = false;

  B makeBatch();
  Future<T> addToBatch(B batch, V param);
  void handleBatch(Map<I, B> batch);

  Future<T> get(I id, [V param]) {
    if (!_scheduled) {
      _scheduled = true;
      Timer.run(() {
        _scheduled = false;
        final copy = Map.of(_batch);
        _batch.clear();
        handleBatch(copy);
      });
    }

    return addToBatch(_batch[id] ??= makeBatch(), param);
  }
}

// Changing these `void`s below to `Null` made the error go away
abstract class _SimpleBatch<I, T> with _Batch<I, void, T, Completer<T>> {
  @override
  Completer<T> makeBatch() => Completer.sync();

  @override
  Future<T> addToBatch(Completer<T> completer, void param) => completer.future;
}

Analyzer reports no errors.

@vsmenon vsmenon added the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues.
Projects
None yet
Development

No branches or pull requests

2 participants