Improve documentation

This commit is contained in:
Pieter Vander Vennet 2022-10-17 16:06:23 +02:00
parent 838fefba8b
commit 87362f93c1
3 changed files with 4 additions and 5 deletions

View file

@ -11,7 +11,7 @@ namespace AspectedRouting.IO.md
{
private readonly List<string> parts = new List<string>();
public string ToString()
public override string ToString()
{
return string.Join("\n\n", parts);
}

View file

@ -156,7 +156,7 @@ namespace AspectedRouting.Language.Expression
internal IExpression OptimizeInternal(out bool somethingChanged)
{
if (Types.Count() == 0)
if (!Types.Any())
{
throw new ArgumentException("This application contain no valid types, so cannot be optimized" + this);
}

View file

@ -88,15 +88,14 @@ namespace AspectedRouting.Language
}
var eSmallest = e.SpecializeToSmallestType();
if (eSmallest == null || eSmallest.Types.Count() == 0)
if (eSmallest == null || !eSmallest.Types.Any())
{
throw new Exception("Could not specialize " + e);
}
// TODO FIX THIS so that it works
// An argument 'optimizes' it's types from 'string -> bool' to 'string -> string'
var eOpt = eSmallest.Optimize(out _);
if (eOpt == null || eOpt.Types.Count() == 0)
if (eOpt == null || !eOpt.Types.Any())
{
throw new Exception("Could not optimize " + eSmallest);
}