Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

ddc does not respect classes emulating functions in dart #19

Closed
jacob314 opened this issue Jan 7, 2015 · 2 comments
Closed

ddc does not respect classes emulating functions in dart #19

jacob314 opened this issue Jan 7, 2015 · 2 comments

Comments

@jacob314
Copy link
Contributor

jacob314 commented Jan 7, 2015

https://www.dartlang.org/articles/emulating-functions/

Repro:

typedef WindowClickHandler(Object e);

class DefaultWindowClickHandler {
  void call(Object e) { }
}

WindowClickHandler h = new DefaultWindowClickHandler(); 
// Generates an error as DefaultWindowClickHandler is not a WindowClickHandler

@jacob314
Copy link
Contributor Author

jacob314 commented Jan 8, 2015

Another example from Angular

class ExceptionHandler {

 /**
  * Delegate uncaught exception for central error handling.
  *
  * - [error] The error which was caught.
  * - [stack] The stacktrace.
  * - [reason] Optional contextual information for the error.
  */
  call(dynamic error, dynamic stack, [String reason = '']) {
    print("$error\n$reason\nSTACKTRACE:\n$stack");
  }
}

DDC:severe: StaticTypeError, Type check failed: exceptionHandler: _exceptionHandler (ExceptionHandler) is not of type (dynamic, dynamic) → void

    count = rootWatchGroup.detectChanges(
        exceptionHandler: _exceptionHandler,
        changeLog: changeLog,
        fieldStopwatch: _scopeStats.fieldStopwatch,
        evalStopwatch: _scopeStats.evalStopwatch,
        processStopwatch: _scopeStats.processStopwatch);

@vsmenon
Copy link
Contributor

vsmenon commented Jan 8, 2015

Leaf has some todos for this case in rules.dart.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants