提交 c9b3cfdd 编写于 作者: K Kevin Halverson

Merge pull request #1198 from KevinH-MS/master

Minor refactorings:
......@@ -3774,7 +3774,7 @@ static void M()
}
}
var references = ImmutableArray.Create<MetadataReference>(
var references = ImmutableArray.Create(
MscorlibRef,
referenceD0,
referenceN0, // From D0
......@@ -3790,11 +3790,11 @@ static void M()
// Expression references ambiguous modules.
string error;
context.CompileExpression("x.F0 + y.F0", out error);
Assert.Equal(error, "error CS7079: The type 'A0' is defined in a module that has not been added. You must add the module '" + assemblyName + "_N0.netmodule'.");
Assert.Equal("error CS7079: The type 'A0' is defined in a module that has not been added. You must add the module '" + assemblyName + "_N0.netmodule'.", error);
context.CompileExpression("y.F0", out error);
Assert.Equal(error, "error CS7079: The type 'A0' is defined in a module that has not been added. You must add the module '" + assemblyName + "_N0.netmodule'.");
Assert.Equal("error CS7079: The type 'A0' is defined in a module that has not been added. You must add the module '" + assemblyName + "_N0.netmodule'.", error);
context.CompileExpression("z.F1", out error);
Assert.Equal(error, "error CS7079: The type 'A1' is defined in a module that has not been added. You must add the module '" + assemblyName + "_N0.netmodule'.");
Assert.Equal("error CS7079: The type 'A1' is defined in a module that has not been added. You must add the module '" + assemblyName + "_N0.netmodule'.", error);
// Expression does not reference ambiguous modules.
var testData = new CompilationTestData();
......
......@@ -159,9 +159,10 @@ private static PortableExecutableReference MakeAssemblyMetadata(ModuleMetadata m
internal static string GetFileNameWithoutExtension(string fileName)
{
var lastDotIndex = fileName.LastIndexOf('.');
if ((lastDotIndex > 0) && (lastDotIndex + 1 < fileName.Length))
var extensionStartIndex = lastDotIndex + 1;
if ((lastDotIndex > 0) && (extensionStartIndex < fileName.Length))
{
var extension = fileName.Substring(lastDotIndex + 1);
var extension = fileName.Substring(extensionStartIndex);
switch (extension)
{
case "dll":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册