Skip to content

Conversation

@jaredpar
Copy link
Member

Next phase in the VB test helper changes. This unifies our CreateCompilation helpers to match the style of the C# counterparts.

Items specifically excluded from this change:

  • Changes to CreateCompilation...AndReferences. These methods will be going away as they are redundant with their counterparts that lack the AndReferences suffix.
  • Changes to CompileAndVerify

Both of these items are coming but they are largely refactoring operations. Going to separate that out into a separate PR to help with the reviews.

@jaredpar jaredpar requested review from a team as code owners February 28, 2018 21:06
@jaredpar
Copy link
Member Author

CC @dotnet/roslyn-compiler for review

@jinujoseph jinujoseph added this to the Unknown milestone Apr 15, 2018
NuGet.Config Outdated
Copy link
Member

Choose a reason for hiding this comment

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

DO NOT MERGE [](start = 14, length = 12)

This means "do not merge to master" or "do not merge at all"?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was a reminder to myself to delete this line. I failed.

Copy link
Member

Choose a reason for hiding this comment

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

Nit: assemblyName:= probably can be removed.

Copy link
Member

Choose a reason for hiding this comment

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

Nit: extra empty line below

@jcouv
Copy link
Member

jcouv commented Apr 19, 2018

Sounds like you're going to refresh this PR. Ping me afterwards to resume the review. Thanks

@jaredpar jaredpar added the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label May 1, 2018
jaredpar added 4 commits May 29, 2018 12:21
Move the source based CompileAndVerifyFieldMarshal overloads into the
language specific layer. This is a step closer to removing the
GetCompilationForEmit method.
All of the source based operations are now in the language specific
heplers.
@jaredpar jaredpar requested review from a team as code owners May 29, 2018 19:23
@jaredpar jaredpar changed the base branch from dev15.7.x to master May 29, 2018 19:23
@jaredpar jaredpar added PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. and removed PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. labels May 29, 2018
@jaredpar jaredpar removed the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label May 30, 2018
@jaredpar
Copy link
Member Author

@jcouv this is ready for review now.

@jaredpar
Copy link
Member Author

CC @roslyn-compiler for review. The change is actually focused in the following files:

  • BasicTestSource.vb
  • BasicTestBase.vb
  • CompilationTestUtils.vb
  • CommonTestBase.cs
  • TargetFrameworkUtil.cs

Everything else is just an API change reacting to these changes.

Dim assemblyName As String = Nothing
Dim sourceTrees = ParseSourceXml(source, parseOptions, assemblyName)
Dim compilation = CreateEmptyCompilation(sourceTrees, allReferences, options, assemblyName)
Dim compilation = CreateEmptyCompilation(sourceTrees.ToArray(), allReferences, options, assemblyName:=assemblyName)
Copy link
Contributor

Choose a reason for hiding this comment

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

.ToArray() [](start = 60, length = 10)

Is .ToArray() necessary here?

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. There is no way to do an implicit conversion from IEnumerable(Of SyntaxTree) to BasicTestSource as we don't allow widening conversions on interfaces.


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

Dim defaultRefs = If(useLatestFrameworkReferences, LatestVbReferences, DefaultVbReferences)
Dim compilation = CreateCompilationWithMscorlib45AndVBRuntime({syntaxTree}, references:=defaultRefs.Append({ValueTupleRef, SystemRuntimeFacadeRef}), options:=If(compilationOptions, TestOptions.ReleaseDll))
Dim allReferences As IEnumerable(Of MetadataReference)
If useLatestFrameworkReferences Then
Copy link
Contributor

Choose a reason for hiding this comment

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

useLatestFrameworkReferences [](start = 11, length = 28)

Consider moving useLatestFrameworkReferences check into .Add() call.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do on the next PR here.


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

Dim defaultRefs = If(useLatestFramework, LatestVbReferences, DefaultVbReferences)
Dim allReferences = defaultRefs.Concat({ValueTupleRef, SystemRuntimeFacadeRef})
Dim allReferences As IEnumerable(Of MetadataReference) = Nothing
If useLatestFramework Then
Copy link
Contributor

Choose a reason for hiding this comment

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

useLatestFramework [](start = 11, length = 18)

Consider moving into .Add() call.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do on the next PR here.


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


Dim references = {MscorlibRef, SystemRef, MsvbRef}
Return CreateEmptyCompilation(source, references, options, assemblyName)
Return CreateEmptyCompilation(source.ToArray(), references, options:=options, assemblyName:=assemblyName)
Copy link
Contributor

Choose a reason for hiding this comment

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

.ToArray() [](start = 44, length = 10)

Is .ToArray() necessary?

@jaredpar jaredpar merged commit 21f9fc2 into dotnet:master May 31, 2018
@jaredpar jaredpar deleted the fix-basic3 branch May 31, 2018 20:58
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.

4 participants