Checker error reporting

The checker uses the local error function to report errors. Here is the function:

  1. function error(location: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void {
  2. let diagnostic = location
  3. ? createDiagnosticForNode(location, message, arg0, arg1, arg2)
  4. : createCompilerDiagnostic(message, arg0, arg1, arg2);
  5. diagnostics.add(diagnostic);
  6. }