public static void reportRebindProblem(DeferredBindingSite site,
String message) {
MessageSend messageSend = site.messageSend;
Scope scope = site.scope;
CompilationResult compResult = scope.compilationUnitScope().referenceContext().compilationResult();
int startLine = ProblemHandler.searchLineNumber(
compResult.lineSeparatorPositions, messageSend.sourceStart());
DefaultProblem problem = new DefaultProblem(compResult.fileName, message,
IProblem.Unclassified, null, ProblemSeverities.Error,
messageSend.sourceStart, messageSend.sourceEnd, startLine);
compResult.record(problem, scope.referenceContext());
}