Skip to content

Commit

Permalink
Fix nullability warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Dec 16, 2022
1 parent 8f07cca commit 8681ec1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAcc

var operation = Expression.Variable(typeof(IOperation));

return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, WrappedType)), operation).Compile();
return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
}

private IFunctionPointerInvocationOperationWrapper(IOperation operation)
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Compiler/Lightup/LightupHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? typ
? parameter
: Expression.Convert(parameter, type);

Expression result = Expression.Call(instance, property.GetMethod);
Expression result = Expression.Call(instance, property.GetMethod!);
if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))
{
result = Expression.Convert(result, typeof(TProperty));
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/Compiler/RulesetToEditorconfigConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static XElement GetTopLevelRulesetNode(string rulesetFilePath)
var ruleSetDocument = XDocument.Load(xmlReader);

// Find the top level rule set node
var rulesetNode = ruleSetDocument.Elements(RuleSetNodeName).FirstOrDefault();
var rulesetNode = ruleSetDocument.Elements(RuleSetNodeName).First();
Debug.Assert(rulesetNode.Name == RuleSetNodeName);
return rulesetNode;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ static void PopulateRuleIdToComments(string rulesetFilePath, Dictionary<string,
if (node is XElement ruleNode &&
ruleNode.Name == RuleNodeName)
{
XAttribute ruleId = ruleNode.Attribute(RuleIdAttributeName);
XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
if (ruleId != null)
{
foreach (var comment in ruleNode.Nodes().OfType<XComment>())
Expand Down

0 comments on commit 8681ec1

Please sign in to comment.