ParameterInfo constructor

ParameterInfo(
  1. ParameterElement _parameter,
  2. ComponentVisitorExceptionHandler _exceptionHandler
)

Implementation

ParameterInfo(this._parameter, this._exceptionHandler) {
  for (var annotationIndex = 0;
      annotationIndex < _parameter.metadata.length;
      annotationIndex++) {
    final annotation = _parameter.metadata[annotationIndex];
    final annotationValue = annotation.computeConstantValue();
    final indexedAnnotation =
        IndexedAnnotation(_parameter, annotation, annotationIndex);
    if (annotation.constantEvaluationErrors!.isNotEmpty) {
      _exceptionHandler.handle(AngularAnalysisError(
        annotation.constantEvaluationErrors!,
        indexedAnnotation,
      ));
    } else if (annotationValue == null) {
      CompileContext.current.reportAndRecover(BuildError.forAnnotation(
        indexedAnnotation.annotation,
        'Error evaluating annotation',
      ));
    } else {
      _populateTypeInfo(annotationValue, annotation);
    }
  }
}