Ejemplo n.º 1
0
 public override void Apply(Node targetNode)
 {
     if (!(targetNode is CompileUnit))
     {
         Context.Warnings.Add(CompilerWarningFactory.CustomWarning(LexicalInfo, "Use [assembly: StrictMode]"));
     }
     Parameters.Strict = true;
 }
        private InvocationTypeInferenceRule ResolveRule(MethodInvocationExpression invocation, IMethod method, string rule)
        {
            var ruleImpl = typeof(BuiltinRules).GetMethod(rule);

            if (ruleImpl != null)
            {
                return((InvocationTypeInferenceRule)Delegate.CreateDelegate(typeof(InvocationTypeInferenceRule), ruleImpl));
            }

            Warnings.Add(CompilerWarningFactory.CustomWarning(invocation, string.Format("Unknown type inference rule '{0}' on method '{1}'.", rule, method)));
            return(BuiltinRules.NoTypeInference);
        }
Ejemplo n.º 3
0
 public INamespace Build()
 {
     try
     {
         CatalogPublicTypes(_assembly.GetTypes());
     }
     catch (ReflectionTypeLoadException x)
     {
         My <CompilerWarningCollection> .Instance.Add(CompilerWarningFactory.CustomWarning("Could not load types from '" + _assembly + "': " + Builtins.join(x.LoaderExceptions, "\n")));
     }
     return(_root);
 }