✅ Inconsistent accessibility error - no idea where this came from

Full error:
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[])'
Code:
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
it’s raining outside
wait nvm Argument wasnt public
Anton
Anton2mo ago
this happens when something public refers to something non-public
it’s raining outside
sorry anton 👍
Want results from more Discord servers?
Add your server