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); }
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); }