✅ Inconsistent accessibility error - no idea where this came from
Full error:
Code:
Inconsistent accessibility: parameter type 'Argument[]' is less accessible than method 'CLI.ArgParser(string[], Argument[])'
Inconsistent accessibility: parameter type 'Argument[]' is less accessible than method 'CLI.ArgParser(string[], Argument[])'
namespace CommandLine
{
public struct CLI
{
public static Dictionary<string, string> ArgParser(string[] argsFromCLI, Argument[] validArguments)
{
int[] validArgIndexes = Enumerable
.Range(0, argsFromCLI.Length)
.Where(n => validArguments.Contains(argsFromCLI[n]))
.ToArray();
Dictionary<string, string> convertedArgs = [];
for (int x = 0; x < validArgIndexes.Length - 1; x++)
{
int firstIndex = validArgIndexes[x];
int secondIndex = validArgIndexes[x + 1];
string first = argsFromCLI[firstIndex];
string other = string.Join(" ", argsFromCLI[(firstIndex + 1) .. secondIndex]);
convertedArgs.Add(first, other);
}
return convertedArgs;
}
}
}
namespace CommandLine
{
public struct CLI
{
public static Dictionary<string, string> ArgParser(string[] argsFromCLI, Argument[] validArguments)
{
int[] validArgIndexes = Enumerable
.Range(0, argsFromCLI.Length)
.Where(n => validArguments.Contains(argsFromCLI[n]))
.ToArray();
Dictionary<string, string> convertedArgs = [];
for (int x = 0; x < validArgIndexes.Length - 1; x++)
{
int firstIndex = validArgIndexes[x];
int secondIndex = validArgIndexes[x + 1];
string first = argsFromCLI[firstIndex];
string other = string.Join(" ", argsFromCLI[(firstIndex + 1) .. secondIndex]);
convertedArgs.Add(first, other);
}
return convertedArgs;
}
}
}
3 Replies
wait nvm
Argument
wasnt publicthis happens when something public refers to something non-public
sorry anton
👍