Skip to content

Additional Nullability checks for deconstruction:#35016

Merged
chsienki merged 7 commits intodotnet:masterfrom
chsienki:nullable_deconstruct_inner
Apr 30, 2019
Merged

Additional Nullability checks for deconstruction:#35016
chsienki merged 7 commits intodotnet:masterfrom
chsienki:nullable_deconstruct_inner

Conversation

@chsienki
Copy link
Member

  • Check 'this' param for extension deconstruct
  • Re-infer the argument types for generic extension deconstruct
  • Update return type with visited arguments
  • Update tests

Closes #33006

@chsienki
Copy link
Member Author

@dotnet/roslyn-compiler for review please

@chsienki chsienki marked this pull request as ready for review April 16, 2019 23:16
@chsienki chsienki requested a review from a team as a code owner April 16, 2019 23:16
Copy link
Member

@333fred 333fred Apr 18, 2019

Choose a reason for hiding this comment

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

I understand why this is the warning we give, but this warning does not make much sense at first glance. I think it'd probably be worth introducing a custom message for extension deconstruction methods. #WontFix

Copy link
Member Author

@chsienki chsienki Apr 25, 2019

Choose a reason for hiding this comment

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

I switched it to be 8602. Turns out it made the code simpler, and aligned the extension method warnings with the instance method ones. Arguably we could still have a specific warning for these cases, but I'm not sure if it adds much.

Back to the original warnings. I agree we could probably make a dedicated deconstruction warning, but we should do it for all deconstruction, not just extension methods. That's a bigger change than I want to make here, but I'll open a bug to track clarifying them


In reply to: 276820010 [](ancestors = 276820010)

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #35349 to track


In reply to: 278754133 [](ancestors = 278754133,276820010)

Copy link
Member

@333fred 333fred Apr 18, 2019

Choose a reason for hiding this comment

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

Pair2 [](start = 32, length = 5)

Not sure I understand why you needed to introduce Pair2? #ByDesign

Copy link
Member Author

Choose a reason for hiding this comment

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

Without it we return two identical warnings (same class, same parameter), which makes the test less obvious what's going on. I added Pair2 to clarify what's actually being reported.


In reply to: 276820962 [](ancestors = 276820962)

@333fred
Copy link
Member

333fred commented Apr 18, 2019

Please add some tests for Deconstruct extension methods that accept a nullable Pair #Resolved

Copy link
Member

@333fred 333fred Apr 18, 2019

Choose a reason for hiding this comment

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

Note: this will need to be adjusted when features/nullable-api is merged (hopefully later today). #Resolved

@333fred
Copy link
Member

333fred commented Apr 18, 2019

Done review pass (commit 1)

Copy link
Member

@jcouv jcouv Apr 22, 2019

Choose a reason for hiding this comment

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

Feels like there may be a bug here. Probably should be TypeWithAnnotation.Create(node.Type, node.NullableAnnotation).ToTypeWithState() instead. ToTypeWithState handles type parameters.
Please confirm and add a test to illustrate if applicable. #Resolved

Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to re-use the implementation of VisitArguments (line 2669) instead of duplicating some/most of it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not easily. Its a path I started down previously, but ended up being pretty messy too. Happy to give it another go though, if we think it'd be better factored.


In reply to: 277465231 [](ancestors = 277465231)

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

Done with review pass (iteration 1)

@jcouv jcouv self-assigned this Apr 22, 2019
@jcouv jcouv added this to the 16.2 milestone Apr 23, 2019
- Check 'this' param for extension deconstruct
- Re-infer the argument types for generic extension deconstruct
- Update return type with visited arguments
- Update tests
- Visit the right parameter in extension cases too
- Report the warning as a null recevier dereference rather than a null argument (this is consistent with how it works in non-extension cases)
- Add extra tests
@chsienki chsienki force-pushed the nullable_deconstruct_inner branch from 5b01109 to edafac1 Compare April 25, 2019 21:56
@chsienki
Copy link
Member Author

Added Deconstruction_ExtensionMethod_05


In reply to: 484677888 [](ancestors = 484677888)

@chsienki
Copy link
Member Author

@dotnet/roslyn-compiler for a second round of review please

class Program
{
static void F(Pair<object, object?>? p)
static void F(Pair<object, object?> p)
Copy link
Contributor

@cston cston Apr 26, 2019

Choose a reason for hiding this comment

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

F(Pair<object, object?> p) [](start = 16, length = 26)

Please revert this change to ensure we're not reporting a dereference warning invoking Deconstruct. #Resolved

_ = CheckPossibleNullReceiver(right);
}
else
_ = CheckPossibleNullReceiver(right);
Copy link
Contributor

@cston cston Apr 26, 2019

Choose a reason for hiding this comment

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

_ = CheckPossibleNullReceiver(right) [](start = 20, length = 36)

We should not report a warning when calling an extension method that takes a nullable this parameter. #Resolved

}
deconstructMethod = InferMethodTypeArguments(invocation, deconstructMethod, placeholderArgs.ToImmutableAndFree());

// https://github.com/dotnet/roslyn/issues/33006: Update `Deconstruct` method
Copy link
Contributor

@cston cston Apr 26, 2019

Choose a reason for hiding this comment

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

Update Deconstruct method [](start = 70, length = 27)

Are we updating the Deconstruct method when it is an instance method?

For instance, in the following, we should report a warning for y.ToString() but no warning for x.ToString().

class Pair<T, U>
{
    public void Deconstruct(out T t, out U u) => throw null!;
}

class Program
{
    static Pair<T, U> CreatePair<T, U>(T t, U u) => new Pair<T, U>();

    static void F(string? x, object? y)
    {
        if (x == null) return;
        var p = CreatePair(x, y);
        (x, y) = p;
        x.ToString(); // ok
        y.ToString(); // warning
    }
}
``` #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed and added Deconstruction_30 to cover this case


In reply to: 279097281 [](ancestors = 279097281)

@cston
Copy link
Contributor

cston commented Apr 26, 2019

                        var parameter = parameters[i + offset];

Please move this ahead of the if and use in the if branch. #Resolved


Refers to: src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs:4855 in b87e729. [](commit_id = b87e729, deletion_comment = False)

Update the deconstruct method for non extension methods
PR Feedback
Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

LGTM (commit 6)

if (deconstructMethod.IsGenericMethod)
{
// re-infer the deconstruct parameters based on the 'this' parameter
ArrayBuilder<BoundExpression> placeholderArgs = ArrayBuilder<BoundExpression>.GetInstance(n);
Copy link
Contributor

@cston cston Apr 29, 2019

Choose a reason for hiding this comment

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

n [](start = 118, length = 1)

n + 1 #Resolved

(x, y) = p;
x.ToString(); // ok
y.ToString(); // warning
}
Copy link
Contributor

@cston cston Apr 29, 2019

Choose a reason for hiding this comment

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

} [](start = 4, length = 1)

Are we testing re-inferring the Deconstruct() method for nested arguments? Perhaps something like:

    static void F(string? x, object? y)
    {
        if (x == null) return;
        var p = CreatePair(x, CreatePair(x, y));
        object? z;
        (z, (x, y)) = p;
        x.ToString(); // ok
        y.ToString(); // warning
    }
``` #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

Added Deconstruction_31


In reply to: 279571543 [](ancestors = 279571543)

x.ToString(); // 1
y.ToString();
z.ToString(); // 2
}
Copy link
Contributor

@cston cston Apr 29, 2019

Choose a reason for hiding this comment

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

} [](start = 4, length = 1)

Are we testing that method type arguments are based on tracked state of this argument? For instance:

    static void F(string? x, object? y)
    {
        if (x == null) return;
        var p = CreatePair(x, CreatePair(x, y));
        object? z;
        (z, (x, y)) = p;
        x.ToString(); // ok
        y.ToString(); // warning
    }
``` #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

Added Deconstruction_ExtensionMethod_06


In reply to: 279572535 [](ancestors = 279572535)

- Set arraybuilder to correct size
- Add extra tests to cover nested deconstruction argument tracking
@chsienki chsienki merged commit 76a1cb3 into dotnet:master Apr 30, 2019
heejaechang added a commit that referenced this pull request May 2, 2019
* Revoke IVTs to dotnet/roslyn-analyzers

Closes #35102

* Implement InternalsVisibleTo checks

Closes #35064

* Allow a work item for tracking migration of IVTs

* Exclude MonoDevelop IVTs for not loading inside VS

* Exclude Moq IVTs for not loading inside VS

* Track removal of external IVTs for XAML

See #35069

* Remove IVTs to non-existent assemblies

Roslyn.Compilers.CompilerServer.UnitTests removed in 2472120
Roslyn.Test.Utilities.CoreClr removed in cf58bbc
Roslyn.Test.Utilities.Desktop removed in cf58bbc
Roslyn.Compilers.CSharp.PerformanceTests removed in cd33333
Roslyn.Test.Utilities.FX45 removed in b77c547
Roslyn.Compilers.VisualBasic.PerformanceTests never existed (typo from 3c14b04)
Roslyn.Compilers.CSharp.Test.Utilities.Desktop removed in edd89e4

* Track removal of EnC.UnitTests IVTs

See #35071

* Track removal of legacy testing IVTs

See #35072

* Use the assembly name instead of project file name for IVT analysis

* Track removal of project system IVTs

See #35070

* Track removal of Live Share IVTs

See #35074

* Track removal of F# IVTs

See #35076

* Track removal of TypeScript IVTs

See #35077

* Track removal of unit testing IVTs

See #35078

* Track removal of Razor IVTs

See #35079

* Track removal of legacy code analysis IVTs

See #35080

* Track removal of internal testing IVTs

See #35081

* Remove IVTs to non-existent assemblies

Roslyn.InteractiveWindow.UnitTests renamed in 2efc2ce and removed in db7a842
Roslyn.VisualStudio.VisualBasic.Repl renamed in 8ea0f52 and removed in 7ab3b77
Microsoft.VisualStudio.CSharp.Repl removed in 7ab3b77
Microsoft.VisualStudio.VisualBasic.Repl removed in 7ab3b77

* Track removal of IntelliTrace IVTs

See #35084

* Track removal of ExternalDependencyServices IVTs

See #35085

* Simplify null checks using 'is null' and 'is object' (#35017)

* Track removal of CodeLens IVTs

See #35086

* Track removal of Scripting.Desktop IVT

See #35090

* Track removal of Editor.UI.Wpf IVTs

See #35091

* Track removal of Microsoft.VisualStudio.InteractiveServices

See #35098

* Track removal of Xamarin IVTs

See #35099

* Remove IVTs to non-existent assemblies

Roslyn.Compilers.VisualBasic.Test.Utilities.Desktop incorrectly added in a70cdce
VBCSCompilerPortable removed in b2bd77b
Microsoft.CodeAnalysis.CompilerServer removed in b00224e
Roslyn.VisualStudio.Test.Utilities.Next renamed in e0e16d7
Microsoft.CodeAnalysis.Scripting.Destkop.UnitTests never existed (typo)
Roslyn.DebuggerVisualizers removed in d7e4939
Microsoft.VisualStudio.LanguageServices.VisualBasic.UnitTests never existed (typo in 7ab3b77)
Roslyn.Services.Editor.CSharp.UnitTests2 renamed in bb1f97b

* Only process IVTs for the primary solution

* Clean up Build Boss code style and error messaging

* Fix VisitPatternForRewriting.

* install servicehub json files in common7/servicehub folders (#34563)

* moved files

* opt-in to new "serviceOverride": true support and refactor directory structure to share json files with devdiv insertion projects

* added swr for servicehub json files.

* delete projects not needed

* moving to auto generated service.json approach

* made json file included in vsix

* generate swr file

* address PR feedbacks and remove duplications except vsix manifest

* use relative path in json file

* share duplicated string to multiple csproj

* fix swr package name

* PR feedbacks

* Add missing binary back-compat method

This was missed when we were adding another parameter to the one with
optional arguments.

* Use Machine.Arm64 instead of raw value. (#35097)

Changes
Use Machine.Arm64 instead of raw value.
These cases were probably missed on #27023.

* Add unit-tests for fixed issues. (#35094)

Closes #33276.
Closes #31676.

* Update string

* Move to base project so it triggers for CPS

* Be resilient to cases where a language service is moving to a new assembly

Fixes #34987

* Fix sorting of import completion items

* Track IVT removal in Microsoft.CodeAnalysis.Scripting

See #5661

* Clarify primary solution argument for build boss

* Addressing Review comments.

- Added condition to handle cases when invocation is null.
- Added corresponding unit test.

* Use button over vs:button to have high contrast work correctly. Set the HelpText dynamically

* Remove unneeded properties from stack panel

* Correctly report null reference possibility when GetEnumerator returns a potentially nullable Enumerator type.

* Added test for previously fixed #34667

* Addressed PR feedback.

* Update nullable attribute in docs (#34763)

* Update nullable attribute in docs

Update nullable attribute in docs to show NullableFlags

* Update nullable-reference-types.md

* Fix the pull member up failure (#34581)

* Add missing parameters and tests

* Address feedback

* Removing extra null check.

* PR feedback

* `Equals` for generic methods should compare nullable annotations for type type arguments. (#35116)

Fixes #35083.

* Intellisense broken inside of methods that have delegates as arguments (#35067)

* Addressed pr feedback, added new test to demonstrate #35151.

* Targeted Completion Prototype

* Use tag name instead of literal text

* Make target-typed completion an experiment

* More strictly keep original code

* Rename some helpers

* Switch to "CorrelationScope" icon

* Add initial tests and telementry

* Telemetry

* Remove redundant check

* Unit tests

* Whitespace

* Handle multitargeting

* More descriptive comment

* Rename local

* Add a couple tests

* Update unit test Trait name

* Renaming some things from "matching type" to "target typed"

* More renaming from matchingType -> targetTyped

* Add VB tests

* Update string to "Target type matches"

* Rename "MatchingType" to "TargetTypeMatch" more places

* Rename to TargetTypedFilters

* Improved telemetry

* More correct telemetry

* Improve linked file handling

* Fix & improve telemetry

* PR feedback

* Definitely avoid some allocations

* Remove a repeated allocation.

* Formatting

* Fix mismerge

* Fix mismerges

* Fix mismerges

* Fix mismerge

* Avoid caching VS completion items for non-import items

* Regex Completion + Async Completion = Failure to trigger on `[` in VB (#34988)

* Fix typos

* Cleanup missed prototype comments.

* Add link to tracking bug

* Async-enumerator methods honor the EnumeratorCancellation attribute (#35121)

* Revert "Remove the dependence between the order in NullableAnnotation and metadata attribute values (#34909)"

This reverts commit e922628.

* Fix complete statement's semicolon placement to better handle incomplete code (#35024)

* Fix for 34983

* Cleanup, fix For statements

* Add more tests

* Respond to feedback

* Fix spelling

* Binary log for Unix bootstrap

Generate a binary log file for the bootstrap phase on Unix platforms.

* Add 16.1P3 to .yml files

* Update PublishData for Dev16.1 Preview 3

* Use correct branch name for 16.1 Preview 3

* Re-enable set -e

* Add test to assert relative order of completion items

* Update PublishData for 16.1 Preview 3 and 16.2 Preview 1

* Update eng/config/PublishData.json

Co-Authored-By: dpoeschl <dpoeschl@gmail.com>

* Update eng/config/PublishData.json

Co-Authored-By: dpoeschl <dpoeschl@gmail.com>

* Implement IMethodSymbol.ReceiverNullableAnnotation.

* Fix to modify tooltip text instead of helptext

* Revert "Add tests for experiment service"

This reverts commit 42fe72d.

* Add import placement codestyle, diagnostic, and fixer (#35009)

* Add import placement codestyle option

* Add TextEditor CodeStyle options for Using Placement

* Add misplaced using directives analyzer and code fix

* Use consistent pluralization

* Removed Preserve AddImportPlacement option

* Removed Preserve from CSharp Style Options

* Removed Preserve from editorconfig tests

* Coverted to Roslyn style analyzer and fixer tests.

* Simplified MisplacedUsings CodeFix based on feedback.

* Simplified MisplacedUsings CodeFix based on feedback.

* Add warning annotation to moved using directives

* Move misplaced usings out of multiple namespaces

* Deduplicate usings when moving them

* Simplified move usings warning text

* Add expected warning markers to misplaced using tests

* Fix editor config generator tests

* Consolidated diagnostics and tests

* Add tests where directives are in both contexts

* Update Versions.props for 16.2

* Update Language Feature Status.md

* Add version check to enable the pattern-based Index & Range indexers (#35170)

* Implement an alternative way to break cycles while calculating IsValueType/IsReferenceType for a type parameter. (#35145)

Fixes #30081.

* Using FQN instead of adding import during ENC session

* Use 'is null' when in C#7 when adding null checks for a parameter.

* Don't add null checks for nullable-structs.  The fact that they're nullable indicates they don't need checks.

* Fix callers

* Simplify

* Fix

* Make bootstrap 32 bit in 32 bit CI

This changes our bootstrap compiler to run as a 32 bit process in the 32
bit CI runs. The intent of this runs is to validate we can function on
32 bit systems and that should extend to the compiler as well.

This can help us identify the rare cases where we emit code that doesn't
perform well on the 32 bit JIT, or just outright crashes.

* Don't suggest static members in PropertySubPatternCompletionProvider

* Revert two step initialization of base type in PENamedTypeSymbol. (#35189)

Related to #28834.

Also, remove obsolete comments from a test. Closes #30003.

* Ensure we refresh ruleset severities after a ruleset change

If a ruleset file changed, we didn't always reapply the new values
in the IDE. For legacy projects the IDE is taking the ruleset files
and applying them to the compilation; for CPS projects that's being done
when we call into the compiler to parse the command line string. We
forgot to reparse the command line string, so CPS projects wouldn't
refresh until some other command line string changed or the project
was unloaded or reloaded.

Fixes #35164

* Revert "Revert "Add tests for experiment service""

This reverts commit adbcf8a.

* Only emit readonly attributes implicitly when feature enabled (#35213)

* Only emit readonly attributes implicitly when readonly members feature is enabled

* Comment about reasoning and use Theory for test

* Use Properties indexer instead of Add() to track pasted span

* VisualBasic semantic model does not recognize overloads at chained queries (#35155)

* Add spec for enhanced using (#34697)

* Add spec for enhanced using

* Create a shared experiment service mock

* Fix existing tests

* Treat CandidateReason MemberGroup the same as Abiguous when classifying NameSyntax

* Rename mock service

* Don't provide sync namespace refactoring in generated code

* Update azure-pipelines* for dev16.1-preview3*

* Update versions.props for 16.1 preview 4

* Update PublishData for 16.1 preview3 and preview4

* Optimise DisplayClass Allocations (#32092)

The current implementation of closure conversion creates closure environments for each
new scope. This change tries to minimize the number of closure environments, and thus
closure environment allocations, when possible by merging "adjacent" closure environments.

To merge two closure environments, they have to:

1. Be captured by exactly the same set of closures
2. Have no backwards branching between the allocation of the two environments
3. Have the same environment lifetime

If so, all of the variables will be merged into a single closure environment. 

Fixes #29965

* intellisense should suggest event after readonly in a struct member declaration (#35234)

* intellisense should suggest event after writing readonly in a struct member declaration.

* Avoid repetition of keywords in EventKeywordRecommender

* Re-enable symbol tests on mono (#35265)

* Remove usage of QuietRestore (#35264)

* Readonly struct and readonly member metadata as source (#34778)

* Implement MetadataAsSource for ref and readonly structs

* MetadataAsSource for readonly members

* Fix NotImplementedException errors. Fix some ArrayBuilder leaks.

* Fix a leak. Fix implicit readonly attribute test.

* List passed to GetUpdatedDeclarationAccessibilityModifiers needs to support Remove

* Allow specifying a metadata language version for MetadataAsSourceTests

* Remove unused SyntaxTokenList members. Comment readonly event generation.

* Check VB MetadataAsSource for readonly members

* Fixes from feedback

* Add test for not implicitly readonly struct getter

* Label arguments in call to GetCustomAttributesForToken

* Reference issue about readonly event public API

* Fix crash in pattern matching (#35249)

When we relaxed the requirement for pattern matching open types to a
constant pattern to not require a conversion from the pattern expression
to the open type, but the pattern expression should be required to have
a constant value.

Fixes #34980

* Warn for CancellationToken parameters missing [EnumeratorCancellation] (#35254)

* Use of unannotated unconstrained type parameter in nullable diabled code (#34889)

A reference to an unconstrained type parameter in nullable-disabled code should be treated as *oblivious*, and therefore reading them should be considered to produce non-null values, and we are permitted to assign null values to them without a diagnostic.
Fixes #34842

Also disable the old WRN_DotOnDefault when the nullable feature is enabled.
Fixes #34855

* Error for `typeof(T?)` when `T` is a reference type (#35001)

Fixes #29894

* Make Generated syntax trees restore to project-level nullability (#35018)

* Make Generated syntax trees restore to project nullability

* Focus first tabbable element in PMU dialog (#35212)

* Add new optprof test for training

* Update foreach based on nullable analysis

This makes 2 changes:
1. Reinfer the GetEnumerator method based on nullable analysis of the
foreach expression type.
2. Use that information to update the collection element type based on
that same analysis.

* Update DynamicFileInfo.cs

* Fix applying code actions that change AdditionalDocuments

Some code was accidentally calling GetDocument with an additional
document ID; this didn't end well.

* VS 2017 -> VS 2019

* Fix broken link in Language Feature Status

Fix link to Nullable reference types specification

* Fix more links in Language Feature Status

Fix links to recursive patterns and async streams specifications

* Move to non Int pools

Responding to a request from our core engineering team to move to a
different pool.

* Remove unnecessary parameter

The `CoreCompile` targets for C# and VB were both passing the set of `PotentialEditorConfigFiles` to the `PotentialAnalyzerConfigFiles` input parameter of `CscTask`/`VbcTask`. However, this parameter no longer exists. At one point in the development of the editorconfig-in-compiler feature we had a separate MSBuild task that would compute both the actual and potential .editorconfig file paths and pass them to the task. These are now computed as part of the MSBuild evaluation pass, and the potential .editorconfig files are passed to the project systems via a separate target (`GetPotentialEditorConfigFiles` in Microsoft.Common.CurrentVersion.targets).

* Make sure nullability mismatch in constraints specified in different partial declarations (types/methods) are properly detected and reported. (#35272)

 Make sure nullability mismatch in constraints specified in different partial declarations (types/methods) are properly detected and reported.

Fixes #30229.
Fixes #35179.

Implements the following LDM decision:

For partial types, the invariant matching from type inference and merging. A mismatch
between two non-oblivious candidates produces an error. No warnings are produced.

For partial methods, nullability has to match with exception for oblivious and we produce warnings.
For the result, we use the implementation signature inside the implementation, and the
declaration signature for the callers.

* Make compilation outputs available via a workspace service (#34809)

* Handle dynamic null checks against literal null (#34996)

Fixes #30939

* Clean up an assertion in LambdaRewriter. (#35284)

Fixes #30069

* Fixup from bad merge. (#35351)

* Addressed pr feedback.

* Lambdas in array initializers checked in nullable walker (#35030)

Also fixes a corresponding issue in the switch expression
Fixes #34299
See also #35029

* Null inferences do not flow out of a finally block. (#35276)

Fixes #34018

* changed the way we report live analysis to task center (#35336)

* changed the way we report live analysis to task center

previously, we listen to diagnostic service to report progress. problem is that, it only raise event if it found errors on a file. so what we report is actually last file we found errors on rather than file that we are analyzing.

this caused confusion since we report in task center that we are analyzing file "A" when it is actually "analyzed" not "analyzing"

another issue is since it only report file that contains errors. we might not actually show anything in task center if there is no error, or show file "A" for long time if that is only file with errors.

this PR changes the experience closer to what users would expects. and now progress is for solution crawler not specifically on diagnostics.

now we report file that solution crawler is analyzing.

there is still cavet such as solution cralwer can pause between processing a file if VS is busy. but it will still show file "A". or we will not update UI at least 200ms a part and etc.

since it is task center where we don't want to be too impactful to VS, based on feeedback we will see whether we need to do more such as detect solution crawlwer pause and update task center to show pasue. or update task center to show different stage such as analyzing/analyzed.

or show in task center, what analyzer is actually running such as diagnostic, todo, designer attribute scan, find all reference cache and etc.

* addressing PR feedbacks

* Handle val escape for the switch expression. (#35311)

Fixes #35278

* Additional Nullability checks for deconstruction: (#35016)

* Additional Nullability checks for deconstruction:
- Check 'this' param for extension deconstruct
- Re-infer the argument types for generic extension deconstruct
- Update the deconstruction method in instance cases
- Update return type with visited arguments
- Update tests

* Correct nullability analysis in conditional access (#34973)

Fixes #29956

Also introduce a helper `TypeSymbol.IsVoidType()`

* Use Button instead of vs:Button on warning dialog for PMU (#35344)

* Update version for Microsoft.Net.Test.Sdk package

This change is required in order to enable running on non-desktop TFM tests from VS test explorer window.

* [master] Update dependencies from dotnet/arcade (#34831)

* Update dependencies from https://github.com/dotnet/arcade build 20190407.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19207.1

* Update dependencies from https://github.com/dotnet/arcade build 20190409.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19209.2

* Update dependencies from https://github.com/dotnet/arcade build 20190410.7

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19210.7

* Update dependencies from https://github.com/dotnet/arcade build 20190411.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19211.2

* Update dependencies from https://github.com/dotnet/arcade build 20190412.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19212.2

* Update dependencies from https://github.com/dotnet/arcade build 20190413.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19213.2

* Update dependencies from https://github.com/dotnet/arcade build 20190414.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19214.2

* Update dependencies from https://github.com/dotnet/arcade build 20190415.12

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19215.12

* Update dependencies from https://github.com/dotnet/arcade build 20190417.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19217.1

* Update dependencies from https://github.com/dotnet/arcade build 20190418.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19218.1

* Update dependencies from https://github.com/dotnet/arcade build 20190418.4

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19218.4

* Update dependencies from https://github.com/dotnet/arcade build 20190418.7

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19218.7

* Update dependencies from https://github.com/dotnet/arcade build 20190422.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19222.2

* Update dependencies from https://github.com/dotnet/arcade build 20190423.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19223.2

* Use Arcade CoreXT package support

* Update dependencies from https://github.com/dotnet/arcade build 20190424.9

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19224.9

* Fix signing

* Update dependencies from https://github.com/dotnet/arcade build 20190425.5

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19225.5

* Update dependencies from https://github.com/dotnet/arcade build 20190426.3

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19226.3

* Update dependencies from https://github.com/dotnet/arcade build 20190429.8

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19229.8

* Update dependencies from https://github.com/dotnet/arcade build 20190430.6

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19230.6

* Use more robust initialization for TypeWithAnnotations.Builder (#35373)

* Auto-generate assembly version of the build task assembly (#35238)
svick added a commit to metalama/Metalama.Compiler that referenced this pull request May 29, 2024
svick added a commit to metalama/Metalama.Compiler that referenced this pull request May 29, 2024
prochan2 added a commit to metalama/Metalama.Compiler that referenced this pull request May 30, 2024
svick added a commit to metalama/Metalama.Compiler that referenced this pull request Jun 3, 2024
svick added a commit to metalama/Metalama.Compiler that referenced this pull request Jun 3, 2024
…g-missing-assembly

dotnet#35016 Add back .Net Framework System.Composition assemblies to the package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include additional nullability checks for extension method Deconstruct

4 participants