Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using Analyzer.Utilities;

namespace Microsoft.NetCore.Analyzers.InteropServices
{
Expand All @@ -22,14 +23,28 @@ public sealed partial class PlatformCompatibilityAnalyzer
/// - UnsupportedFirst - keeps the lowest version of [UnsupportedOSPlatform] attribute found
/// - UnsupportedSecond - keeps the second lowest version of [UnsupportedOSPlatform] attribute found
/// </summary>
private class PlatformAttributes
private class Versions
{
public Version? SupportedFirst { get; set; }
public Version? SupportedSecond { get; set; }
public Version? UnsupportedFirst { get; set; }
public Version? UnsupportedSecond { get; set; }
public bool HasAttribute() => SupportedFirst != null || UnsupportedFirst != null ||
public bool IsSet() => SupportedFirst != null || UnsupportedFirst != null ||
SupportedSecond != null || UnsupportedSecond != null;
}

private class PlatformAttributes
{
public PlatformAttributes() { }

public PlatformAttributes(Callsite callsite, SmallDictionary<string, Versions> platforms)
{
Callsite = callsite;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of attributes kept in the cache i needed to add Call-site info for subsequent calls made within that call site

Platforms = platforms;
}

public SmallDictionary<string, Versions>? Platforms { get; set; }
public Callsite Callsite { get; set; }
}
}
}
Loading