Skip to content

A fixed initializer must be bound to its natural type#46293

Merged
gafter merged 3 commits intodotnet:masterfrom
gafter:master-46231
Jul 27, 2020
Merged

A fixed initializer must be bound to its natural type#46293
gafter merged 3 commits intodotnet:masterfrom
gafter:master-46231

Conversation

@gafter
Copy link
Member

@gafter gafter commented Jul 24, 2020

Fixes #46231

@gafter gafter added this to the 16.8 milestone Jul 24, 2020
@gafter gafter requested a review from a team as a code owner July 24, 2020 01:27
@gafter gafter self-assigned this Jul 24, 2020
public class Program {
public static void Test(bool b, IDisposable d)
{
using (IDisposable x = b ? d : null)
Copy link
Member

Choose a reason for hiding this comment

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

Does the implementation change affect the behavior of this test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. It causes the compiler to not crash. Other than that, no.

Copy link
Member

Choose a reason for hiding this comment

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

I was not able to crash the compiler in the master branch using this scenario. I was able to crash it using the TestFixedConditional scenario above. This seems like a good test to have anyway, though.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right; this test is just a defensive one for a "similar" situation to the one that is actually affected here.

@gafter
Copy link
Member Author

gafter commented Jul 24, 2020

Build failures are inherited from the master branch.

@gafter gafter requested a review from a team July 25, 2020 19:49
@RikkiGibson
Copy link
Member

Does this need to go into 16.8-preview1?

333fred added a commit to 333fred/roslyn that referenced this pull request Jul 28, 2020
…-pointers

* upstream/master: (207 commits)
  Update argument state when parameter has not-null type (dotnet#46072)
  Fix TypeWithAnnotations.ToTypeWithState() for (untyped) null literal (dotnet#46344)
  Update README (dotnet#46136)
  Revert "Revert "Support nullable annotations on unconstrained type parameters""
  Revert "Support nullable annotations on unconstrained type parameters (dotnet#45993)"
  Fix type in publish data
  Update VSIXExpInstaller version to one available on ADO
  Update publish data for 16.8
  Update version of RichCodeNav.EnvVarDump
  A fixed initializer must be bound to its natural type (dotnet#46293)
  Update features merged into 16.7p4 (dotnet#46229)
  Async-streams: disposal should continue without jump within a finally (dotnet#46188)
  Recommend default in type constraint, but not record (dotnet#46311)
  Add use site diagnostics to IsUnmanaged (dotnet#46114)
  Add another flaky test.
  Ensure NuGet connections use TLS 1.2
  Update to Microsoft.CodeAnalysis.Testing 1.0.1-beta1.20374.2
  Skip flaky test.
  Fix build break. (dotnet#46303)
  Skip a flaky test Relates to dotnet#46304
  ...
333fred added a commit to 333fred/roslyn that referenced this pull request Jul 28, 2020
…to function-pointer-type-lookup

* upstream/features/function-pointers: (212 commits)
  Correct public API number.
  Update argument state when parameter has not-null type (dotnet#46072)
  Fix TypeWithAnnotations.ToTypeWithState() for (untyped) null literal (dotnet#46344)
  Update README (dotnet#46136)
  Revert "Revert "Support nullable annotations on unconstrained type parameters""
  Revert "Support nullable annotations on unconstrained type parameters (dotnet#45993)"
  Fix type in publish data
  Update VSIXExpInstaller version to one available on ADO
  Update publish data for 16.8
  Update version of RichCodeNav.EnvVarDump
  A fixed initializer must be bound to its natural type (dotnet#46293)
  Update features merged into 16.7p4 (dotnet#46229)
  Async-streams: disposal should continue without jump within a finally (dotnet#46188)
  Recommend default in type constraint, but not record (dotnet#46311)
  Add use site diagnostics to IsUnmanaged (dotnet#46114)
  Add another flaky test.
  Ensure NuGet connections use TLS 1.2
  Update to Microsoft.CodeAnalysis.Testing 1.0.1-beta1.20374.2
  Skip flaky test.
  Fix build break. (dotnet#46303)
  ...
@RikkiGibson RikkiGibson modified the milestones: Next, 16.8.P2 Aug 11, 2020
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.

ASP.NET Core dependencies build failure

3 participants