private static string doResolve(LinkerErrorCode errCode) { switch (errCode) { //case LinkerErrorCode.LNK0000: return "Ident using acces operator '::' at non-allowed room"; case LinkerErrorCode.LNK0001: return "Could not locate function reference for Ident"; case LinkerErrorCode.LNK0002: return "Type Missmatch, function with given ArgList could not be located"; case LinkerErrorCode.LNK0003: return "Invalid Encapsulation, accessing private scope outside of class context"; case LinkerErrorCode.LNK0004: return "Invalid Encapsulation, accessing protected scope outside of parented context"; case LinkerErrorCode.LNK0005: return "Invalid Operator, object is not implementing ArrayAccess operator"; case LinkerErrorCode.LNK0006: return "Invalid Operator, vartype is not supporting ArrayAccess operator"; case LinkerErrorCode.LNK0007: return "Missing Type, cannot evaluate type for 'auto' variable due to missing assign"; case LinkerErrorCode.LNK0008: return "Type Missmatch, LValue type differs from RValue type"; case LinkerErrorCode.LNK0009: case LinkerErrorCode.LNK0010: case LinkerErrorCode.LNK0011: return "Invalid Operation, variable is defined twice"; case LinkerErrorCode.LNK0012: return "Could not locate variable reference for Ident"; case LinkerErrorCode.LNK0013: return "Type Missmatch, Array type is not consistent"; case LinkerErrorCode.LNK0014: return "Type Missmatch, Expression arg types not valid. "; case LinkerErrorCode.LNK0015: return "SQF Command is missing LArgs"; case LinkerErrorCode.LNK0016: return "SQF Command should have LArgs"; case LinkerErrorCode.LNK0017: return "SQF Command is missing RArgs"; case LinkerErrorCode.LNK0018: return "SQF Command should have RArgs"; case LinkerErrorCode.LNK0019: return "SQF Command is not registered in SupportInfo list"; case LinkerErrorCode.LNK0020: return "Invalid case, default was experienced twice"; case LinkerErrorCode.LNK0021: return "Function is not always returning a value"; case LinkerErrorCode.LNK0022: case LinkerErrorCode.LNK0023: return "Type Missmatch, type differs from functions return type"; case LinkerErrorCode.LNK0024: return "Type Missmatch, case type differs from switch type"; case LinkerErrorCode.LNK0025: return "Invalid Operation, constructors are not allowed to return values"; case LinkerErrorCode.LNK0026: return "Invalid Operation, constructors cannot be callen outside of a NEW operation"; case LinkerErrorCode.LNK0027: return "Invalid Operation, entry points have to be static"; case LinkerErrorCode.LNK0028: return "Type Missmatch, LArg has to refer to an object"; case LinkerErrorCode.LNK0029: return "Type Missmatch, RArg has to refer to a class or an interface"; case LinkerErrorCode.LNK0030: return "Type Missmatch, LArg is not allowed to be casted"; case LinkerErrorCode.LNK0031: return "Cast Exception, non-object to object"; case LinkerErrorCode.LNK0032: return "Cast Exception, non-static object got static-casted"; case LinkerErrorCode.LNK0033: return "Cast Exception, object to non-object/{string}"; case LinkerErrorCode.LNK0034: case LinkerErrorCode.LNK0035: return "Cast Exception, selfcast"; case LinkerErrorCode.LNK0036: return "Cast Exception, non-object with dynamic cast"; case LinkerErrorCode.LNK0037: return "Invalid Operation, implementing class"; case LinkerErrorCode.LNK0038: return "Invalid Operation, extending interface"; case LinkerErrorCode.LNK0039: return "Function overrides existing function"; case LinkerErrorCode.LNK0040: return "Missing override keyword on overriding function"; case LinkerErrorCode.LNK0041: return "Invalid Operation, too many arguments on override"; case LinkerErrorCode.LNK0042: return "Invalid Operation, lacking arguments on override"; case LinkerErrorCode.LNK0043: return "Type Missmatch, override has different type then base"; case LinkerErrorCode.LNK0044: return "Type Missmatch, override return differs from base"; default: return "Unknown Error, report to dev with reproduction code (fix other issues first)."; } }
private static string doResolve(LinkerErrorCode errCode) { switch (errCode) { //case LinkerErrorCode.LNK0000: return "Ident using acces operator '::' at non-allowed room"; case LinkerErrorCode.LNK0001: return("Could not locate function reference for Ident"); case LinkerErrorCode.LNK0002: return("Type Missmatch, function with given ArgList could not be located"); case LinkerErrorCode.LNK0003: return("Invalid Encapsulation, accessing private scope outside of class context"); case LinkerErrorCode.LNK0004: return("Invalid Encapsulation, accessing protected scope outside of parented context"); case LinkerErrorCode.LNK0005: return("Invalid Operator, object is not implementing ArrayAccess operator"); case LinkerErrorCode.LNK0006: return("Invalid Operator, vartype is not supporting ArrayAccess operator"); case LinkerErrorCode.LNK0007: return("Missing Type, cannot evaluate type for 'auto' variable due to missing assign"); case LinkerErrorCode.LNK0008: return("Type Missmatch, LValue type differs from RValue type"); case LinkerErrorCode.LNK0009: case LinkerErrorCode.LNK0010: case LinkerErrorCode.LNK0011: return("Invalid Operation, variable is defined twice"); case LinkerErrorCode.LNK0012: return("Could not locate reference for Ident"); case LinkerErrorCode.LNK0013: return("Type Missmatch, Array type is not consistent"); case LinkerErrorCode.LNK0014: return("Type Missmatch, Expression arg types not valid. "); case LinkerErrorCode.LNK0015: return("SQF Command is missing LArgs"); case LinkerErrorCode.LNK0016: return("SQF Command should have LArgs"); case LinkerErrorCode.LNK0017: return("SQF Command is missing RArgs"); case LinkerErrorCode.LNK0018: return("SQF Command should have RArgs"); case LinkerErrorCode.LNK0019: return("SQF Command is not registered in SupportInfo list"); case LinkerErrorCode.LNK0020: return("Invalid case, default was experienced twice"); case LinkerErrorCode.LNK0021: return("Function is not always returning a value"); case LinkerErrorCode.LNK0022: case LinkerErrorCode.LNK0023: return("Type Missmatch, type differs from functions return type"); case LinkerErrorCode.LNK0024: return("Type Missmatch, case type differs from switch type"); case LinkerErrorCode.LNK0025: return("Invalid Operation, constructors are not allowed to return values"); case LinkerErrorCode.LNK0026: return("Invalid Operation, constructors cannot be callen outside of a NEW operation"); case LinkerErrorCode.LNK0027: return("Invalid Operation, entry points have to be static"); case LinkerErrorCode.LNK0028: return("Type Missmatch, LArg has to refer to an object"); case LinkerErrorCode.LNK0029: return("Type Missmatch, RArg has to refer to a class or an interface"); case LinkerErrorCode.LNK0030: return("Type Missmatch, LArg is not allowed to be casted"); case LinkerErrorCode.LNK0031: return("Cast Exception, non-object to object"); /*case LinkerErrorCode.LNK0032: return "Cast Exception, non-static object got static-casted";*/ case LinkerErrorCode.LNK0033: return("Cast Exception, object to non-object"); case LinkerErrorCode.LNK0034: return("Cast Exception, selfcast"); /*case LinkerErrorCode.LNK0035: return "Cast Exception, selfcast";*/ /*case LinkerErrorCode.LNK0036: return "Cast Exception, non-object with dynamic cast";*/ case LinkerErrorCode.LNK0037: return("Invalid Operation, implementing class"); case LinkerErrorCode.LNK0038: return("Invalid Operation, extending interface"); case LinkerErrorCode.LNK0039: return("Invalid Operation, Parent function is not marked as virtual"); case LinkerErrorCode.LNK0040: return("Missing virtual keyword on overriding function"); case LinkerErrorCode.LNK0041: return("Invalid Operation, too many arguments on override"); case LinkerErrorCode.LNK0042: return("Invalid Operation, lacking arguments on override"); case LinkerErrorCode.LNK0043: return("Type Missmatch, override has different type then base"); case LinkerErrorCode.LNK0044: return("Type Missmatch, override return differs from base"); case LinkerErrorCode.LNK0045: return("Resolving ident failed"); case LinkerErrorCode.LNK0046: return("Resolving ident failed, path is unknown"); case LinkerErrorCode.LNK0047: return("Type Missmatch, enum types differ from each other"); case LinkerErrorCode.LNK0048: return("Invalid Operation, enum idents resolve to same value"); case LinkerErrorCode.LNK0049: return("Invalid Operation, static native function tries to access _this"); case LinkerErrorCode.LNK0050: return("Type Missmatch, Expression has to return scalar"); case LinkerErrorCode.LNK0051: return("Invalid Operation, variable name collides with object variable"); case LinkerErrorCode.LNK0052: return("Invalid Operation, Native functions are not derefable"); case LinkerErrorCode.LNK0053: return("Invalid Operation, Virtual Functions are not derefable"); case LinkerErrorCode.LNK0054: return("Invalid Operation, Non-Static Variables are not derefable"); case LinkerErrorCode.LNK0055: return("Invalid Operation, using this in static functions"); case LinkerErrorCode.LNK0056: return("Type Missmatch, Variable has to be type Exception"); case LinkerErrorCode.LNK0057: return("Type Missmatch, Expression has to be type Exception"); case LinkerErrorCode.LNK0058: return("Type Missmatch, Async functions have be of type script"); case LinkerErrorCode.LNK0059: return("Missing Attribute, throwing functions have to use the throwing attribute"); case LinkerErrorCode.LNK0060: return("Invalid Operation, more then one PreInit function detected"); default: return("Unknown Error, report to dev with reproduction code (fix other issues first)."); } }
public static string resolve(LinkerErrorCode errCode, int line = -1, int pos = -1, string file = default(string)) { return(Enum.GetName(typeof(LinkerErrorCode), errCode) + ": " + doResolve(errCode) + ". " + (line == -1 ? "" : "line " + line.ToString() + (pos == -1 ? "" : " col " + pos.ToString()) + (string.IsNullOrEmpty(file) ? "" : " file '" + file + "'"))); }
public static string resolve(LinkerErrorCode errCode, int line = -1, int pos = -1) { return Enum.GetName(typeof(LinkerErrorCode), errCode) + ": " + doResolve(errCode) + ". " + (line == -1 ? "" : "line " + line.ToString() + (pos == -1 ? "" : " col " + pos.ToString())); }