Skip to content

Commit 6b58000

Browse files
authored
Merge pull request #3723 from sfoslund/InferredTypeVariableName
Confirm DisableImplicitNamespaceImports solves inferred type variable name issue
2 parents 419501c + 522f848 commit 6b58000

File tree

4 files changed

+69
-23
lines changed

4 files changed

+69
-23
lines changed

.vsts-ci.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,12 @@ stages:
8383
_PublishType: none
8484
_SignType: test
8585

86-
- template: /eng/build.yml
87-
parameters:
88-
agentOs: Ubuntu_14_04
89-
pool:
90-
name: Hosted Ubuntu 1604
91-
strategy:
92-
matrix:
93-
Build_Debug:
94-
_BuildConfig: Debug
95-
_PublishType: none
96-
_SignType: test
97-
Build_Release:
98-
_BuildConfig: Release
99-
_PublishType: none
100-
_SignType: test
101-
variables:
102-
_PREVIEW_VSTS_DOCKER_IMAGE: microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-0cd4667-20170319080304
103-
10486
- template: /eng/build.yml
10587
parameters:
10688
agentOs: Ubuntu_16_04
10789
pool:
108-
name: Hosted Ubuntu 1604
90+
name: NetCorePublic-Pool
91+
queue: BuildPool.Ubuntu.1604.Amd64.Open
10992
strategy:
11093
matrix:
11194
Build_Debug:
@@ -116,8 +99,6 @@ stages:
11699
_BuildConfig: Release
117100
_PublishType: none
118101
_SignType: test
119-
variables:
120-
_PREVIEW_VSTS_DOCKER_IMAGE: microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-e435274-20180628134544
121102

122103
- template: /eng/build.yml
123104
parameters:
@@ -165,7 +146,8 @@ stages:
165146
parameters:
166147
agentOs: Linux_Perf_CI
167148
pool:
168-
name: Hosted Ubuntu 1604
149+
name: NetCorePublic-Pool
150+
queue: BuildPool.Ubuntu.1604.Amd64.Open
169151
strategy:
170152
matrix:
171153
Build_Release:
@@ -184,4 +166,4 @@ stages:
184166
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
185167
- template: /eng/common/templates/post-build/post-build.yml
186168
parameters:
187-
enableSymbolValidation: false
169+
enableSymbolValidation: false
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<RootNamespace>InferredTypeVaraibleName</RootNamespace>
6+
<TargetFramework>netcoreapp3.0</TargetFramework>
7+
</PropertyGroup>
8+
9+
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Imports System
2+
3+
Module Program
4+
Sub Main(args As String())
5+
Console.WriteLine("Hello World!")
6+
End Sub
7+
8+
Sub Foo()
9+
Dim dataObject As Object
10+
For Each format In dataObject.GetFormats()
11+
12+
Next
13+
End Sub
14+
End Module
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.IO;
5+
using FluentAssertions;
6+
using Microsoft.NET.TestFramework;
7+
using Microsoft.NET.TestFramework.Assertions;
8+
using Microsoft.NET.TestFramework.Commands;
9+
using Xunit;
10+
using Xunit.Abstractions;
11+
12+
namespace Microsoft.NET.Build.Tests
13+
{
14+
public class GivenThatWeWantImplicitNamespaceImportsDisabled : SdkTest
15+
{
16+
public GivenThatWeWantImplicitNamespaceImportsDisabled(ITestOutputHelper log) : base(log)
17+
{
18+
}
19+
20+
[Fact]
21+
public void It_builds_with_implicit_namespace_imports_disabled()
22+
{
23+
var asset = _testAssetsManager
24+
.CopyTestAsset("InferredTypeVariableName")
25+
.WithSource();
26+
27+
var buildCommand = new BuildCommand(Log, Path.Combine(asset.TestRoot));
28+
29+
buildCommand
30+
.Execute()
31+
.Should()
32+
.Fail()
33+
.And.HaveStdOutContaining("BC30455");
34+
35+
buildCommand
36+
.Execute("/p:DisableImplicitNamespaceImports=true")
37+
.Should()
38+
.Pass();
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)