New Issue: better error for mismatches for extern procs

18053, "mppf", "better error for mismatches for extern procs", "2021-07-12T15:06:05Z"

Summary of Problem

Mismatches between argument and return types between extern proc and C declarations don't generate friendly error messages.

Steps to Reproduce

Source Code:

// header.h
static void returnVoidFromVoidArg(void) { }
static int returnIntFromIntArg(int arg) { return arg; }
static void returnVoidFromIntArg(int arg) { }
static int returnIntFromVoidArg(void) { return 1; }
// b1.chpl
require "header.h";

extern proc returnVoidFromVoidArg(arg: int): int;

proc main() {
  var x = returnVoidFromVoidArg(1);
}

Compile command:
(with the default LLVM backend)

$ chpl b1.chpl 
chpl: /usr/lib/llvm-11/include/llvm/ADT/ArrayRef.h:248: const T& llvm::ArrayRef<T>::operator[](size_t) const [with T = clang::CodeGen::CGFunctionInfoArgInfo; size_t = long unsigned int]: Assertion `Index < Length && "Invalid index!"' failed.
Aborted (core dumped)

Associated Future Test(s):
TODO