Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSven Boemer <sbomer@gmail.com>2021-10-19 21:42:12 +0300
committerGitHub <noreply@github.com>2021-10-19 21:42:12 +0300
commit4c9de67922b2381aed29c6dff2c892ff6467f114 (patch)
tree6ba7c46cab304cae9a2a2107b3e0b050b16613f7 /test
parentc75a5240bd253e2e407438cbaa14c9d1bf714343 (diff)
Nullable annotations part 4 (final) (#2300)
* Nullable annotations part 4 (final) * PR feedback - Clean up extra variables introduced as nullable versions of existing variables. * Fix a few annotations - TryGetMethodStubValue may return null when true - GetReturnType and GetParameterType may return null in some cases * More annotations and PR feedback - Don't resolve a generic typeref that should already be a typedef - Remove some redundant null checks - Turn on nullable annotations for ref assembly - Remove #nullable disable section * Clean up GetInflatedDeclaringType - Remove null check - Replace TryResolve call with an assert - Add comment and asserts justifying null-forgiving operator * Replace exception with assert in accessors * PR feedback - Add parens to improve readability - Throw on diagnostic without message - Remove unnecessary string.empty * Undo DiagnosticString change - Some DiagnosticIds intentionally have no fixed format strings because we generate different strings in different circumstances.
Diffstat (limited to 'test')
-rw-r--r--test/ILLink.Tasks.Tests/ILLink.Tasks.Tests.cs2
-rw-r--r--test/ILLink.Tasks.Tests/Mock.cs14
2 files changed, 8 insertions, 8 deletions
diff --git a/test/ILLink.Tasks.Tests/ILLink.Tasks.Tests.cs b/test/ILLink.Tasks.Tests/ILLink.Tasks.Tests.cs
index dbf9bb427..216dec205 100644
--- a/test/ILLink.Tasks.Tests/ILLink.Tasks.Tests.cs
+++ b/test/ILLink.Tasks.Tests/ILLink.Tasks.Tests.cs
@@ -382,7 +382,7 @@ namespace ILLink.Tasks.Tests
}
}
}
-#nullable disable
+#nullable restore
public static IEnumerable<object[]> CustomDataCases => new List<object[]> {
new object [] {
diff --git a/test/ILLink.Tasks.Tests/Mock.cs b/test/ILLink.Tasks.Tests/Mock.cs
index 681834087..dba28887b 100644
--- a/test/ILLink.Tasks.Tests/Mock.cs
+++ b/test/ILLink.Tasks.Tests/Mock.cs
@@ -101,13 +101,13 @@ namespace ILLink.Tasks.Tests
SetupContext (Logger);
}
- public LinkContext Context => context;
+ public new LinkContext Context => base.Context;
public CustomLogger Logger { get; private set; }
public IEnumerable<string> GetRootAssemblies ()
{
- foreach (var step in context.Pipeline.GetSteps ()) {
+ foreach (var step in Context.Pipeline.GetSteps ()) {
if (!(step is RootAssemblyInput))
continue;
@@ -121,7 +121,7 @@ namespace ILLink.Tasks.Tests
public IEnumerable<string> GetRootDescriptors ()
{
- foreach (var step in context.Pipeline.GetSteps ()) {
+ foreach (var step in Context.Pipeline.GetSteps ()) {
if (!(step is ResolveFromXmlStep))
continue;
@@ -133,7 +133,7 @@ namespace ILLink.Tasks.Tests
public IEnumerable<string> GetReferenceAssemblies ()
{
- return (IEnumerable<string>) typeof (AssemblyResolver).GetField ("_references", BindingFlags.NonPublic | BindingFlags.Instance).GetValue (context.Resolver);
+ return (IEnumerable<string>) typeof (AssemblyResolver).GetField ("_references", BindingFlags.NonPublic | BindingFlags.Instance).GetValue (Context.Resolver);
}
protected override void AddResolveFromXmlStep (Pipeline pipeline, string file)
@@ -150,7 +150,7 @@ namespace ILLink.Tasks.Tests
public IEnumerable<IDependencyRecorder> GetDependencyRecorders ()
{
- return (IEnumerable<IDependencyRecorder>) typeof (Tracer).GetField ("recorders", BindingFlags.NonPublic | BindingFlags.Instance).GetValue (context.Tracer);
+ return (IEnumerable<IDependencyRecorder>) typeof (Tracer).GetField ("recorders", BindingFlags.NonPublic | BindingFlags.Instance).GetValue (Context.Tracer);
}
public new bool GetOptimizationName (string optimization, out CodeOptimizations codeOptimizations)
@@ -160,13 +160,13 @@ namespace ILLink.Tasks.Tests
public CodeOptimizations GetDefaultOptimizations ()
{
- return context.Optimizations.Global;
+ return Context.Optimizations.Global;
}
public Dictionary<string, string> GetCustomData ()
{
var field = typeof (LinkContext).GetField ("_parameters", BindingFlags.NonPublic | BindingFlags.Instance);
- return (Dictionary<string, string>) field.GetValue (this.context);
+ return (Dictionary<string, string>) field.GetValue (Context);
}
protected override List<BaseStep> CreateDefaultResolvers ()