1 /* ****************************************************************************
3 * Copyright (c) Microsoft Corporation.
5 * This source code is subject to terms and conditions of the Apache License, Version 2.0. A
6 * copy of the license can be found in the License.html file at the root of this distribution. If
7 * you cannot locate the Apache License, Version 2.0, please send an email to
8 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
9 * by the terms of the Apache License, Version 2.0.
11 * You must not remove this notice, or any other, from this software.
14 * ***************************************************************************/
18 namespace Microsoft.Scripting {
20 internal static partial class Strings {
21 private static string FormatString(string format, params object[] args) {
22 return string.Format(System.Globalization.CultureInfo.CurrentCulture, format, args);
26 #region Generated Microsoft.Scripting Exception Factory
28 // *** BEGIN GENERATED CODE ***
29 // generated by function: gen_expr_factory_scripting from: generate_exception_factory.py
32 /// Strongly-typed and parameterized string factory.
35 internal static partial class Strings {
37 /// A string like "Cannot access member {1} declared on type {0} because the type contains generic parameters."
39 internal static string InvalidOperation_ContainsGenericParameters(object p0, object p1) {
40 return FormatString("Cannot access member {1} declared on type {0} because the type contains generic parameters.", p0, p1);
44 /// A string like "Type '{0}' is missing or cannot be loaded."
46 internal static string MissingType(object p0) {
47 return FormatString("Type '{0}' is missing or cannot be loaded.", p0);
51 /// A string like "static property "{0}" of "{1}" can only be read through a type, not an instance"
53 internal static string StaticAccessFromInstanceError(object p0, object p1) {
54 return FormatString("static property \"{0}\" of \"{1}\" can only be read through a type, not an instance", p0, p1);
58 /// A string like "static property "{0}" of "{1}" can only be assigned to through a type, not an instance"
60 internal static string StaticAssignmentFromInstanceError(object p0, object p1) {
61 return FormatString("static property \"{0}\" of \"{1}\" can only be assigned to through a type, not an instance", p0, p1);
65 /// A string like "Method precondition violated"
67 internal static string MethodPreconditionViolated {
69 return "Method precondition violated";
74 /// A string like "Invalid argument value"
76 internal static string InvalidArgumentValue {
78 return "Invalid argument value";
83 /// A string like "Non-empty string required"
85 internal static string NonEmptyStringRequired {
87 return "Non-empty string required";
92 /// A string like "Non-empty collection required"
94 internal static string NonEmptyCollectionRequired {
96 return "Non-empty collection required";
101 /// A string like "must by an Exception instance"
103 internal static string MustBeExceptionInstance {
105 return "must by an Exception instance";
110 /// A string like "Type of test must be bool"
112 internal static string TypeOfTestMustBeBool {
114 return "Type of test must be bool";
119 /// A string like "Type of the expression must be bool"
121 internal static string TypeOfExpressionMustBeBool {
123 return "Type of the expression must be bool";
128 /// A string like "Empty string is not a valid path."
130 internal static string EmptyStringIsInvalidPath {
132 return "Empty string is not a valid path.";
137 /// A string like "Invalid delegate type (Invoke method not found)."
139 internal static string InvalidDelegate {
141 return "Invalid delegate type (Invoke method not found).";
146 /// A string like "expected only static property"
148 internal static string ExpectedStaticProperty {
150 return "expected only static property";
155 /// A string like "Property doesn't exist on the provided type"
157 internal static string PropertyDoesNotExist {
159 return "Property doesn't exist on the provided type";
164 /// A string like "Field doesn't exist on provided type"
166 internal static string FieldDoesNotExist {
168 return "Field doesn't exist on provided type";
173 /// A string like "Type doesn't have constructor with a given signature"
175 internal static string TypeDoesNotHaveConstructorForTheSignature {
177 return "Type doesn't have constructor with a given signature";
182 /// A string like "Type doesn't have a method with a given name."
184 internal static string TypeDoesNotHaveMethodForName {
186 return "Type doesn't have a method with a given name.";
191 /// A string like "Type doesn't have a method with a given name and signature."
193 internal static string TypeDoesNotHaveMethodForNameSignature {
195 return "Type doesn't have a method with a given name and signature.";
200 /// A string like "Count must be non-negative."
202 internal static string CountCannotBeNegative {
204 return "Count must be non-negative.";
209 /// A string like "arrayType must be an array type"
211 internal static string ArrayTypeMustBeArray {
213 return "arrayType must be an array type";
218 /// A string like "Either code or target must be specified."
220 internal static string MustHaveCodeOrTarget {
222 return "Either code or target must be specified.";
227 /// A string like "Type parameter is {0}. Expected a delegate."
229 internal static string TypeParameterIsNotDelegate(object p0) {
230 return FormatString("Type parameter is {0}. Expected a delegate.", p0);
234 /// A string like "Cannot cast from type '{0}' to type '{1}"
236 internal static string InvalidCast(object p0, object p1) {
237 return FormatString("Cannot cast from type '{0}' to type '{1}", p0, p1);
241 /// A string like "unknown member type: '{0}'. "
243 internal static string UnknownMemberType(object p0) {
244 return FormatString("unknown member type: '{0}'. ", p0);
248 /// A string like "RuleBuilder can only be used with delegates whose first argument is CallSite."
250 internal static string FirstArgumentMustBeCallSite {
252 return "RuleBuilder can only be used with delegates whose first argument is CallSite.";
257 /// A string like "no instance for call."
259 internal static string NoInstanceForCall {
261 return "no instance for call.";
266 /// A string like "Missing Test."
268 internal static string MissingTest {
270 return "Missing Test.";
275 /// A string like "Missing Target."
277 internal static string MissingTarget {
279 return "Missing Target.";
284 /// A string like "The operation requires a non-generic type for {0}, but this represents generic types only"
286 internal static string NonGenericWithGenericGroup(object p0) {
287 return FormatString("The operation requires a non-generic type for {0}, but this represents generic types only", p0);
291 /// A string like "Invalid operation: '{0}'"
293 internal static string InvalidOperation(object p0) {
294 return FormatString("Invalid operation: '{0}'", p0);
298 /// A string like "Finally already defined."
300 internal static string FinallyAlreadyDefined {
302 return "Finally already defined.";
307 /// A string like "Can not have fault and finally."
309 internal static string CannotHaveFaultAndFinally {
311 return "Can not have fault and finally.";
316 /// A string like "Fault already defined."
318 internal static string FaultAlreadyDefined {
320 return "Fault already defined.";
325 /// A string like "Cannot create default value for type {0}."
327 internal static string CantCreateDefaultTypeFor(object p0) {
328 return FormatString("Cannot create default value for type {0}.", p0);
332 /// A string like "Unhandled convert: {0}"
334 internal static string UnhandledConvert(object p0) {
335 return FormatString("Unhandled convert: {0}", p0);
339 /// A string like "{0}.{1} has no publiclly visible method."
341 internal static string NoCallableMethods(object p0, object p1) {
342 return FormatString("{0}.{1} has no publiclly visible method.", p0, p1);
346 /// A string like "Global/top-level local variable names must be unique."
348 internal static string GlobalsMustBeUnique {
350 return "Global/top-level local variable names must be unique.";
355 /// A string like "Generating code from non-serializable CallSiteBinder."
357 internal static string GenNonSerializableBinder {
359 return "Generating code from non-serializable CallSiteBinder.";
364 /// A string like "pecified path is invalid."
366 internal static string InvalidPath {
368 return "pecified path is invalid.";
373 /// A string like "Dictionaries are not hashable."
375 internal static string DictionaryNotHashable {
377 return "Dictionaries are not hashable.";
382 /// A string like "language already registered."
384 internal static string LanguageRegistered {
386 return "language already registered.";
391 /// A string like "The method or operation is not implemented."
393 internal static string MethodOrOperatorNotImplemented {
395 return "The method or operation is not implemented.";
400 /// A string like "No exception."
402 internal static string NoException {
404 return "No exception.";
409 /// A string like "Extension type {0} must be public."
411 internal static string ExtensionMustBePublic(object p0) {
412 return FormatString("Extension type {0} must be public.", p0);
416 /// A string like "Already initialized."
418 internal static string AlreadyInitialized {
420 return "Already initialized.";
425 /// A string like "CreateScopeExtension must return a scope extension."
427 internal static string MustReturnScopeExtension {
429 return "CreateScopeExtension must return a scope extension.";
434 /// A string like "Invalid number of parameters for the service."
436 internal static string InvalidParamNumForService {
438 return "Invalid number of parameters for the service.";
443 /// A string like "Invalid type of argument {0}; expecting {1}."
445 internal static string InvalidArgumentType(object p0, object p1) {
446 return FormatString("Invalid type of argument {0}; expecting {1}.", p0, p1);
450 /// A string like "Cannot change non-caching value."
452 internal static string CannotChangeNonCachingValue {
454 return "Cannot change non-caching value.";
459 /// A string like "Field {0} is read-only"
461 internal static string FieldReadonly(object p0) {
462 return FormatString("Field {0} is read-only", p0);
466 /// A string like "Property {0} is read-only"
468 internal static string PropertyReadonly(object p0) {
469 return FormatString("Property {0} is read-only", p0);
473 /// A string like "Expected event from {0}.{1}, got event from {2}.{3}."
475 internal static string UnexpectedEvent(object p0, object p1, object p2, object p3) {
476 return FormatString("Expected event from {0}.{1}, got event from {2}.{3}.", p0, p1, p2, p3);
480 /// A string like "expected bound event, got {0}."
482 internal static string ExpectedBoundEvent(object p0) {
483 return FormatString("expected bound event, got {0}.", p0);
487 /// A string like "Expected type {0}, got {1}."
489 internal static string UnexpectedType(object p0, object p1) {
490 return FormatString("Expected type {0}, got {1}.", p0, p1);
494 /// A string like "can only write to member {0}."
496 internal static string MemberWriteOnly(object p0) {
497 return FormatString("can only write to member {0}.", p0);
501 /// A string like "No code to compile."
503 internal static string NoCodeToCompile {
505 return "No code to compile.";
510 /// A string like "Invalid stream type: {0}."
512 internal static string InvalidStreamType(object p0) {
513 return FormatString("Invalid stream type: {0}.", p0);
517 /// A string like "Queue empty."
519 internal static string QueueEmpty {
521 return "Queue empty.";
526 /// A string like "Enumeration has not started. Call MoveNext."
528 internal static string EnumerationNotStarted {
530 return "Enumeration has not started. Call MoveNext.";
535 /// A string like "Enumeration already finished."
537 internal static string EnumerationFinished {
539 return "Enumeration already finished.";
544 /// A string like "can't add another casing for identifier {0}"
546 internal static string CantAddCasing(object p0) {
547 return FormatString("can't add another casing for identifier {0}", p0);
551 /// A string like "can't add new identifier {0}"
553 internal static string CantAddIdentifier(object p0) {
554 return FormatString("can't add new identifier {0}", p0);
558 /// A string like "Type '{0}' doesn't provide a suitable public constructor or its implementation is faulty: {1}"
560 internal static string InvalidCtorImplementation(object p0, object p1) {
561 return FormatString("Type '{0}' doesn't provide a suitable public constructor or its implementation is faulty: {1}", p0, p1);
565 /// A string like "Invalid output directory."
567 internal static string InvalidOutputDir {
569 return "Invalid output directory.";
574 /// A string like "Invalid assembly name or file extension."
576 internal static string InvalidAsmNameOrExtension {
578 return "Invalid assembly name or file extension.";
583 /// A string like "Cannot emit constant {0} ({1})"
585 internal static string CanotEmitConstant(object p0, object p1) {
586 return FormatString("Cannot emit constant {0} ({1})", p0, p1);
590 /// A string like "No implicit cast from {0} to {1}"
592 internal static string NoImplicitCast(object p0, object p1) {
593 return FormatString("No implicit cast from {0} to {1}", p0, p1);
597 /// A string like "No explicit cast from {0} to {1}"
599 internal static string NoExplicitCast(object p0, object p1) {
600 return FormatString("No explicit cast from {0} to {1}", p0, p1);
604 /// A string like "name '{0}' not defined"
606 internal static string NameNotDefined(object p0) {
607 return FormatString("name '{0}' not defined", p0);
611 /// A string like "No default value for a given type."
613 internal static string NoDefaultValue {
615 return "No default value for a given type.";
620 /// A string like "Specified language provider type is not registered."
622 internal static string UnknownLanguageProviderType {
624 return "Specified language provider type is not registered.";
629 /// A string like "can't read from property"
631 internal static string CantReadProperty {
633 return "can't read from property";
638 /// A string like "can't write to property"
640 internal static string CantWriteProperty {
642 return "can't write to property";
647 /// A string like "Cannot create instance of {0} because it contains generic parameters"
649 internal static string IllegalNew_GenericParams(object p0) {
650 return FormatString("Cannot create instance of {0} because it contains generic parameters", p0);
654 /// A string like "Non-verifiable assembly generated: {0}:\nAssembly preserved as {1}\nError text:\n{2}\n"
656 internal static string VerificationException(object p0, object p1, object p2) {
657 return FormatString("Non-verifiable assembly generated: {0}:\nAssembly preserved as {1}\nError text:\n{2}\n", p0, p1, p2);
662 /// Strongly-typed and parameterized exception factory.
665 internal static partial class Error {
667 /// ArgumentException with message like "Either code or target must be specified."
669 internal static Exception MustHaveCodeOrTarget() {
670 return new ArgumentException(Strings.MustHaveCodeOrTarget);
674 /// InvalidOperationException with message like "Type parameter is {0}. Expected a delegate."
676 internal static Exception TypeParameterIsNotDelegate(object p0) {
677 return new InvalidOperationException(Strings.TypeParameterIsNotDelegate(p0));
681 /// InvalidOperationException with message like "Cannot cast from type '{0}' to type '{1}"
683 internal static Exception InvalidCast(object p0, object p1) {
684 return new InvalidOperationException(Strings.InvalidCast(p0, p1));
688 /// InvalidOperationException with message like "unknown member type: '{0}'. "
690 internal static Exception UnknownMemberType(object p0) {
691 return new InvalidOperationException(Strings.UnknownMemberType(p0));
695 /// InvalidOperationException with message like "RuleBuilder can only be used with delegates whose first argument is CallSite."
697 internal static Exception FirstArgumentMustBeCallSite() {
698 return new InvalidOperationException(Strings.FirstArgumentMustBeCallSite);
702 /// InvalidOperationException with message like "no instance for call."
704 internal static Exception NoInstanceForCall() {
705 return new InvalidOperationException(Strings.NoInstanceForCall);
709 /// InvalidOperationException with message like "Missing Test."
711 internal static Exception MissingTest() {
712 return new InvalidOperationException(Strings.MissingTest);
716 /// InvalidOperationException with message like "Missing Target."
718 internal static Exception MissingTarget() {
719 return new InvalidOperationException(Strings.MissingTarget);
723 /// TypeLoadException with message like "The operation requires a non-generic type for {0}, but this represents generic types only"
725 internal static Exception NonGenericWithGenericGroup(object p0) {
726 return new TypeLoadException(Strings.NonGenericWithGenericGroup(p0));
730 /// ArgumentException with message like "Invalid operation: '{0}'"
732 internal static Exception InvalidOperation(object p0) {
733 return new ArgumentException(Strings.InvalidOperation(p0));
737 /// InvalidOperationException with message like "Finally already defined."
739 internal static Exception FinallyAlreadyDefined() {
740 return new InvalidOperationException(Strings.FinallyAlreadyDefined);
744 /// InvalidOperationException with message like "Can not have fault and finally."
746 internal static Exception CannotHaveFaultAndFinally() {
747 return new InvalidOperationException(Strings.CannotHaveFaultAndFinally);
751 /// InvalidOperationException with message like "Fault already defined."
753 internal static Exception FaultAlreadyDefined() {
754 return new InvalidOperationException(Strings.FaultAlreadyDefined);
758 /// ArgumentException with message like "Cannot create default value for type {0}."
760 internal static Exception CantCreateDefaultTypeFor(object p0) {
761 return new ArgumentException(Strings.CantCreateDefaultTypeFor(p0));
765 /// ArgumentException with message like "Unhandled convert: {0}"
767 internal static Exception UnhandledConvert(object p0) {
768 return new ArgumentException(Strings.UnhandledConvert(p0));
772 /// InvalidOperationException with message like "{0}.{1} has no publiclly visible method."
774 internal static Exception NoCallableMethods(object p0, object p1) {
775 return new InvalidOperationException(Strings.NoCallableMethods(p0, p1));
779 /// ArgumentException with message like "Global/top-level local variable names must be unique."
781 internal static Exception GlobalsMustBeUnique() {
782 return new ArgumentException(Strings.GlobalsMustBeUnique);
786 /// ArgumentException with message like "Generating code from non-serializable CallSiteBinder."
788 internal static Exception GenNonSerializableBinder() {
789 return new ArgumentException(Strings.GenNonSerializableBinder);
793 /// ArgumentException with message like "pecified path is invalid."
795 internal static Exception InvalidPath() {
796 return new ArgumentException(Strings.InvalidPath);
800 /// ArgumentTypeException with message like "Dictionaries are not hashable."
802 internal static Exception DictionaryNotHashable() {
803 return new ArgumentTypeException(Strings.DictionaryNotHashable);
807 /// InvalidOperationException with message like "language already registered."
809 internal static Exception LanguageRegistered() {
810 return new InvalidOperationException(Strings.LanguageRegistered);
814 /// NotImplementedException with message like "The method or operation is not implemented."
816 internal static Exception MethodOrOperatorNotImplemented() {
817 return new NotImplementedException(Strings.MethodOrOperatorNotImplemented);
821 /// InvalidOperationException with message like "No exception."
823 internal static Exception NoException() {
824 return new InvalidOperationException(Strings.NoException);
828 /// ArgumentException with message like "Extension type {0} must be public."
830 internal static Exception ExtensionMustBePublic(object p0) {
831 return new ArgumentException(Strings.ExtensionMustBePublic(p0));
835 /// InvalidOperationException with message like "Already initialized."
837 internal static Exception AlreadyInitialized() {
838 return new InvalidOperationException(Strings.AlreadyInitialized);
842 /// InvalidImplementationException with message like "CreateScopeExtension must return a scope extension."
844 internal static Exception MustReturnScopeExtension() {
845 return new InvalidImplementationException(Strings.MustReturnScopeExtension);
849 /// ArgumentException with message like "Invalid number of parameters for the service."
851 internal static Exception InvalidParamNumForService() {
852 return new ArgumentException(Strings.InvalidParamNumForService);
856 /// ArgumentException with message like "Invalid type of argument {0}; expecting {1}."
858 internal static Exception InvalidArgumentType(object p0, object p1) {
859 return new ArgumentException(Strings.InvalidArgumentType(p0, p1));
863 /// ArgumentException with message like "Cannot change non-caching value."
865 internal static Exception CannotChangeNonCachingValue() {
866 return new ArgumentException(Strings.CannotChangeNonCachingValue);
870 /// MissingMemberException with message like "Field {0} is read-only"
872 internal static Exception FieldReadonly(object p0) {
873 return new MissingMemberException(Strings.FieldReadonly(p0));
877 /// MissingMemberException with message like "Property {0} is read-only"
879 internal static Exception PropertyReadonly(object p0) {
880 return new MissingMemberException(Strings.PropertyReadonly(p0));
884 /// ArgumentException with message like "Expected event from {0}.{1}, got event from {2}.{3}."
886 internal static Exception UnexpectedEvent(object p0, object p1, object p2, object p3) {
887 return new ArgumentException(Strings.UnexpectedEvent(p0, p1, p2, p3));
891 /// ArgumentTypeException with message like "expected bound event, got {0}."
893 internal static Exception ExpectedBoundEvent(object p0) {
894 return new ArgumentTypeException(Strings.ExpectedBoundEvent(p0));
898 /// ArgumentTypeException with message like "Expected type {0}, got {1}."
900 internal static Exception UnexpectedType(object p0, object p1) {
901 return new ArgumentTypeException(Strings.UnexpectedType(p0, p1));
905 /// MemberAccessException with message like "can only write to member {0}."
907 internal static Exception MemberWriteOnly(object p0) {
908 return new MemberAccessException(Strings.MemberWriteOnly(p0));
912 /// InvalidOperationException with message like "No code to compile."
914 internal static Exception NoCodeToCompile() {
915 return new InvalidOperationException(Strings.NoCodeToCompile);
919 /// ArgumentException with message like "Invalid stream type: {0}."
921 internal static Exception InvalidStreamType(object p0) {
922 return new ArgumentException(Strings.InvalidStreamType(p0));
926 /// InvalidOperationException with message like "Queue empty."
928 internal static Exception QueueEmpty() {
929 return new InvalidOperationException(Strings.QueueEmpty);
933 /// InvalidOperationException with message like "Enumeration has not started. Call MoveNext."
935 internal static Exception EnumerationNotStarted() {
936 return new InvalidOperationException(Strings.EnumerationNotStarted);
940 /// InvalidOperationException with message like "Enumeration already finished."
942 internal static Exception EnumerationFinished() {
943 return new InvalidOperationException(Strings.EnumerationFinished);
947 /// InvalidOperationException with message like "can't add another casing for identifier {0}"
949 internal static Exception CantAddCasing(object p0) {
950 return new InvalidOperationException(Strings.CantAddCasing(p0));
954 /// InvalidOperationException with message like "can't add new identifier {0}"
956 internal static Exception CantAddIdentifier(object p0) {
957 return new InvalidOperationException(Strings.CantAddIdentifier(p0));
961 /// ArgumentException with message like "Invalid output directory."
963 internal static Exception InvalidOutputDir() {
964 return new ArgumentException(Strings.InvalidOutputDir);
968 /// ArgumentException with message like "Invalid assembly name or file extension."
970 internal static Exception InvalidAsmNameOrExtension() {
971 return new ArgumentException(Strings.InvalidAsmNameOrExtension);
975 /// ArgumentException with message like "Cannot emit constant {0} ({1})"
977 internal static Exception CanotEmitConstant(object p0, object p1) {
978 return new ArgumentException(Strings.CanotEmitConstant(p0, p1));
982 /// ArgumentException with message like "No implicit cast from {0} to {1}"
984 internal static Exception NoImplicitCast(object p0, object p1) {
985 return new ArgumentException(Strings.NoImplicitCast(p0, p1));
989 /// ArgumentException with message like "No explicit cast from {0} to {1}"
991 internal static Exception NoExplicitCast(object p0, object p1) {
992 return new ArgumentException(Strings.NoExplicitCast(p0, p1));
996 /// MissingMemberException with message like "name '{0}' not defined"
998 internal static Exception NameNotDefined(object p0) {
999 return new MissingMemberException(Strings.NameNotDefined(p0));
1003 /// ArgumentException with message like "No default value for a given type."
1005 internal static Exception NoDefaultValue() {
1006 return new ArgumentException(Strings.NoDefaultValue);
1010 /// ArgumentException with message like "Specified language provider type is not registered."
1012 internal static Exception UnknownLanguageProviderType() {
1013 return new ArgumentException(Strings.UnknownLanguageProviderType);
1017 /// InvalidOperationException with message like "can't read from property"
1019 internal static Exception CantReadProperty() {
1020 return new InvalidOperationException(Strings.CantReadProperty);
1024 /// InvalidOperationException with message like "can't write to property"
1026 internal static Exception CantWriteProperty() {
1027 return new InvalidOperationException(Strings.CantWriteProperty);
1031 /// ArgumentException with message like "Cannot create instance of {0} because it contains generic parameters"
1033 internal static Exception IllegalNew_GenericParams(object p0) {
1034 return new ArgumentException(Strings.IllegalNew_GenericParams(p0));
1038 /// System.Security.VerificationException with message like "Non-verifiable assembly generated: {0}:\nAssembly preserved as {1}\nError text:\n{2}\n"
1040 internal static Exception VerificationException(object p0, object p1, object p2) {
1041 return new System.Security.VerificationException(Strings.VerificationException(p0, p1, p2));
1046 // *** END GENERATED CODE ***