Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Remove unnecessary cast now that we are targeting C# 7.3 with latest compiler #2299

Merged
merged 2 commits into from
May 19, 2018

Conversation

ahsonkhan
Copy link
Member

Leftover change from #2161

@ahsonkhan
Copy link
Member Author

FYI, @MisinformedDNA, @JeremyKuhne

https://ci.dot.net/job/dotnet_corefxlab/job/master/job/ubuntu16.04_release_prtest/1979/console

15:06:41 Building and running tests for project tests/System.IO.FileSystem.Watcher.Polling.Tests/System.IO.FileSystem.Watcher.Polling.Tests.csproj...
15:06:41 Test run for /mnt/j/workspace/dotnet_corefxlab/master/ubuntu16.04_release_prtest/tests/System.IO.FileSystem.Watcher.Polling.Tests/bin/Release/netcoreapp2.1/System.IO.FileSystem.Watcher.Polling.Tests.dll(.NETCoreApp,Version=v2.1)
15:06:41 Microsoft (R) Test Execution Command Line Tool Version 15.7.0
15:06:41 Copyright (c) Microsoft Corporation.  All rights reserved.
15:06:41 
15:06:42 Starting test execution, please wait...
15:06:45 The active test run was aborted. Reason: Unhandled Exception: System.ObjectDisposedException: Cannot access a disposed object.
15:06:45    at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)
15:06:45    at System.IO.PollingFileSystemWatcher.TimerHandler(Object context) in /mnt/j/workspace/dotnet_corefxlab/master/ubuntu16.04_release_prtest/src/System.IO.FileSystem.Watcher.Polling/System/IO/PollingFileSystemWatcher.cs:line 208
15:06:45    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
15:06:45 --- End of stack trace from previous location where exception was thrown ---
15:06:45    at System.Threading.TimerQueueTimer.CallCallback()
15:06:45    at System.Threading.TimerQueueTimer.Fire()
15:06:45    at System.Threading.ThreadPoolWorkQueue.Dispatch()
15:06:45 
15:06:45 
15:06:45 Total tests: Unknown. Passed: 17. Failed: 0. Skipped: 0.
15:06:45 Test Run Aborted.
15:06:45 Test execution time: 3.1382 Seconds
15:06:45 Some tests failed in project tests/System.IO.FileSystem.Watcher.Polling.Tests/System.IO.FileSystem.Watcher.Polling.Tests.csproj

Copy link
Member

@GrabYourPitchforks GrabYourPitchforks left a comment

Choose a reason for hiding this comment

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

I think the .props change is fine, but I'd like somebody from the compiler team to chime in just to ensure that compiling in this manner from the command line is supported.

@ahsonkhan
Copy link
Member Author

I'd like somebody from the compiler team to chime in just to ensure that compiling in this manner from the command line is supported.

@agocke - does this change look good to you?

15:06:42 Starting test execution, please wait...
15:06:45 The active test run was aborted. Reason: Unhandled Exception: System.ObjectDisposedException: Cannot access a disposed object.

@dotnet/dnceng, @maririos - is it possible for us to get the repro tool working in corefxlab as well? We have intermittent test failures here that are hard to reproduce and debug (especially in this instance since we can't tell the name of the failing test).

@@ -15,7 +15,5 @@
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Key.snk</AssemblyOriginatorKeyFile>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
<PackageReference Include="Microsoft.NETCore.Compilers" Version="$(RoslynVersion)" PrivateAssets="All" />
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you need this anymore? Do you have a min req for .NET Core that is guaranteed to have C# 7.3?

Copy link
Member Author

@ahsonkhan ahsonkhan May 19, 2018

Choose a reason for hiding this comment

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

Do you have a min req for .NET Core that is guaranteed to have C# 7.3?

Yes we do, but it looks like the csc.dll within roslyn that comes with the dotnet cli that we install has a recent enough version and has support for C#7.3.(https://dotnet.myget.org/feed/roslyn/package/nuget/Microsoft.NETCore.Compilers/2.8.1-beta6-62911-06)
image

Otherwise, the code change in this PR to remove the cast wouldn't compile (based on recent overload resolution changes - dotnet/roslyn#24756). That change wouldn't build on C#7.2.

System\Buffers\Writer\BufferWriter_writable.cs(14,16): error CS0306: The type 'Span' may not be used as a type argument [D:\GitHub\Fork\corefxlab\src\System.Buffers.ReaderWriter\System.Buffers.ReaderWriter.csproj]

@ahsonkhan ahsonkhan merged commit 3e2932b into dotnet:master May 19, 2018
@ahsonkhan ahsonkhan deleted the RemoveCast branch May 19, 2018 00:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants