未验证 提交 25b1d156 编写于 作者: K Kevin Ransom (msft) 提交者: GitHub

Compiler fix and tests (#8803)

上级 7c4248d0
......@@ -5008,9 +5008,6 @@ let ProcessMetaCommandsFromInput
let output = tcConfig.outputDir |> Option.defaultValue ""
let dm = tcConfig.dependencyProvider.TryFindDependencyManagerInPath(tcConfig.compilerToolPaths, output , reportError, path)
match dm with
| dllpath, null when String.IsNullOrWhiteSpace(dllpath) ->
state // error already reported
| _, dependencyManager when not(isNull dependencyManager) ->
if tcConfig.langVersion.SupportsFeature(LanguageFeature.PackageManagement) then
packageRequireF state (dependencyManager, m, path)
......@@ -5020,7 +5017,11 @@ let ProcessMetaCommandsFromInput
// #r "Assembly"
| path, _ ->
dllRequireF state (m, path)
let p =
if String.IsNullOrWhiteSpace(path) then ""
else path
dllRequireF state (m, p)
| _ ->
errorR(Error(FSComp.SR.buildInvalidHashrDirective(), m))
......
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
namespace FSharp.Compiler.UnitTests
open NUnit.Framework
open FSharp.Compiler.SourceCodeServices
[<TestFixture>]
module ``Test Compiler Directives`` =
[<Test>]
let ``compiler #r "" is invalid``() =
let source = """
#r ""
"""
CompilerAssert.CompileWithErrors(
Compilation.Create(source, Fsx, Library),
[|
FSharpErrorSeverity.Warning, 213, (2,1,2,6), "'' is not a valid assembly name"
|])
[<Test>]
let ``compiler #r " " is invalid``() =
let source = """
#r " "
"""
CompilerAssert.CompileWithErrors(
Compilation.Create(source, Fsx, Library),
[|
FSharpErrorSeverity.Warning, 213, (2,1,2,10), "'' is not a valid assembly name"
|])
......@@ -60,6 +60,7 @@
<Compile Include="Compiler\Warnings\ExperimentalAttributeTests.fs" />
<Compile Include="Compiler\Warnings\PatternMatchingWarningTests.fs" />
<Compile Include="Compiler\SourceTextTests.fs" />
<Compile Include="Compiler\Language\CompilerDirectiveTests.fs" />
<Compile Include="Compiler\Language\DefaultInterfaceMemberTests.fs" />
<Compile Include="Compiler\Language\OptionalInteropTests.fs" />
<Compile Include="Compiler\Language\UIntTests.fs" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册