Пример #1
0
 public override Stream <CompilationMessage> VisitVariable(VariableElement field, Void ignored)
 {
     if (field.getAnnotation(typeof(Context)) != null)
     {
         return(_contextFieldVisitor.visitVariable(field, ignored));
     }
     return(ValidateNonContextField(field));
 }
Пример #2
0
        public override Stream <CompilationMessage> VisitVariable(VariableElement parameter, Void ignored)
        {
            Name annotation = parameter.getAnnotation(typeof(Name));

            if (annotation == null)
            {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                return(Stream.of(new ParameterMissingAnnotationError(parameter, AnnotationMirror(parameter.AnnotationMirrors), "@%s usage error: missing on parameter <%s>", typeof(Name).FullName, NameOf(parameter))));
            }

            if (!_parameterTypeVisitor.visit(parameter.asType()))
            {
                Element method = parameter.EnclosingElement;
                return(Stream.of(new ParameterTypeError(parameter, "Unsupported parameter type <%s> of " + "procedure|function" + " %s#%s", parameter.asType().ToString(), method.EnclosingElement.SimpleName, method.SimpleName)));
            }
            return(Stream.empty());
        }