Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Compiler/AbstractIL/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ type PrimaryAssembly =
static member IsPossiblePrimaryAssembly(fileName: string) =
let name = System.IO.Path.GetFileNameWithoutExtension(fileName)

String.Compare(name, "mscorlib", true) <> 0
Copy link
Author

@OwnageIsMagic OwnageIsMagic Oct 1, 2023

Choose a reason for hiding this comment

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

I think there was a bug, so I changed <> to = here. Or I did misunderstood something? This was introduced in #13870

Copy link
Author

Choose a reason for hiding this comment

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

// We check the exported types of all assemblies, since many may forward System.Object,
// but only check the actual type definitions for specific assemblies that we know
// might actually declare System.Object.
match mdef.Manifest with
| Some manifest when
manifest.ExportedTypes.TryFindByName "System.Object" |> Option.isSome
|| PrimaryAssembly.IsPossiblePrimaryAssembly resolvedAssembly.resolvedPath
&& mdef.TypeDefs.ExistsByName "System.Object"
->
mkRefToILAssembly manifest |> Some
| _ -> None

based on calling context this bug was resulting in making any framework assembly as primary assembly equivalent, this may affect some esoteric .NET implementations.

|| String.Compare(name, "System.Runtime", true) <> 0
|| String.Compare(name, "netstandard", true) <> 0
|| String.Compare(name, "System.Private.CoreLib", true) <> 0
String.Equals(name, "mscorlib", StringComparison.OrdinalIgnoreCase)
|| String.Equals(name, "System.Runtime", StringComparison.OrdinalIgnoreCase)
|| String.Equals(name, "netstandard", StringComparison.OrdinalIgnoreCase)
|| String.Equals(name, "System.Private.CoreLib", StringComparison.OrdinalIgnoreCase)

// --------------------------------------------------------------------
// Utilities: type names
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/AbstractIL/ilnativeres.fs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ type VersionHelper() =
let mutable breakLoop = false

while (idx < elements[i].Length) && not breakLoop do
if not (Char.IsDigit elements[i].[idx]) then
if not (isDigit elements[i].[idx]) then
invalidFormat <- true

VersionHelper.TryGetValue((elements[i].Substring(0, idx)), ref values[i])
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/AbstractIL/ilreflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ type TypeBuilder with
type OpCode with

member opcode.RefEmitName =
(string (Char.ToUpper(opcode.Name[0])) + opcode.Name[1..])
(string (Char.ToUpperInvariant(opcode.Name[0])) + opcode.Name[1..])
.Replace(".", "_")
.Replace("_i4", "_I4")

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/AbstractIL/ilwrite.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3756,7 +3756,7 @@ let writePdb (
let pdbfileInfo = FileInfo(pdbfile).FullName

// If pdbfilepath matches output filepath then error
if String.Compare(outfileInfo, pdbfileInfo, StringComparison.InvariantCulture) = 0 then
if outfileInfo = pdbfileInfo then
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the particular motivation for this one?

Copy link
Author

Choose a reason for hiding this comment

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

File systems usually doesn't normalize Unicode in paths, InvariantCulture does

Copy link
Member

Choose a reason for hiding this comment

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

Those paths are CLI arguments, the logic to compare them should stay case insensitive like it was, to keep the behavior the same.

Copy link
Author

Choose a reason for hiding this comment

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

@T-Gro it was InvariantCulture, not InvariantCultureIgnoreCase

Copy link
Author

Choose a reason for hiding this comment

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

@T-Gro do you suggest to actually make it case insensitive?

errorR(Error(FSComp.SR.optsPdbMatchesOutputFileName(), rangeStartup))
try FileSystem.FileDeleteShim pdbfile with _ -> ()
use fs = FileSystem.OpenFileForWriteShim(pdbfile, fileMode = FileMode.Create, fileAccess = FileAccess.ReadWrite)
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/AbstractIL/ilwritepdb.fs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ type PortablePdbGenerator
let includeSource file =
let isInList =
embedSourceList
|> List.exists (fun f -> String.Compare(file, f, StringComparison.OrdinalIgnoreCase) = 0)
|> List.exists (fun f -> String.Equals(file, f, StringComparison.OrdinalIgnoreCase))

if not embedAllSource && not isInList || not (FileSystem.FileExistsShim file) then
None
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ let TryStripPrefixPath (g: TcGlobals) (enclosingNamespacePath: Ident list) =
g.isInteractive &&
not (isNil rest) &&
p.idText.StartsWithOrdinal FsiDynamicModulePrefix &&
p.idText[FsiDynamicModulePrefix.Length..] |> String.forall Char.IsDigit
p.idText[FsiDynamicModulePrefix.Length..] |> String.forall isDigit
-> Some(p, rest)
| _ -> None

Expand Down
12 changes: 6 additions & 6 deletions src/Compiler/Checking/CheckFormatStrings.fs
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ module internal Parse =
let rec digitsPrecision (fmt: string) (fmtPos: int) =
if fmtPos >= fmt.Length then failwith (FSComp.SR.forBadPrecision())
match fmt[fmtPos] with
| c when System.Char.IsDigit c -> digitsPrecision fmt (fmtPos+1)
| c when isDigit c -> digitsPrecision fmt (fmtPos+1)
| _ -> fmtPos

let precision (info: FormatInfoRegister) (fmt: string) (fmtPos: int) =
if fmtPos >= fmt.Length then failwith (FSComp.SR.forBadWidth())
match fmt[fmtPos] with
| c when System.Char.IsDigit c -> info.precision <- true; false,digitsPrecision fmt (fmtPos+1)
| c when isDigit c -> info.precision <- true; false,digitsPrecision fmt (fmtPos+1)
| '*' -> info.precision <- true; true,(fmtPos+1)
| _ -> failwith (FSComp.SR.forPrecisionMissingAfterDot())

Expand All @@ -161,14 +161,14 @@ module internal Parse =
let rec go pos n =
if pos >= len then failwith (FSComp.SR.forBadPrecision())
match fmt[pos] with
| c when System.Char.IsDigit c -> go (pos+1) (n*10 + int c - int '0')
| c when isDigit c -> go (pos+1) (n*10 + int c - int '0')
| _ -> Some n, optionalDotAndPrecision info fmt pos
go fmtPos intAcc

let widthAndPrecision (info: FormatInfoRegister) (fmt: string) (fmtPos: int) =
if fmtPos >= fmt.Length then failwith (FSComp.SR.forBadPrecision())
match fmt[fmtPos] with
| c when System.Char.IsDigit c -> false,digitsWidthAndPrecision info fmt fmtPos 0
| c when isDigit c -> false,digitsWidthAndPrecision info fmt fmtPos 0
| '*' -> true, (None, optionalDotAndPrecision info fmt (fmtPos+1))
| _ -> false, (None, optionalDotAndPrecision info fmt fmtPos)

Expand All @@ -178,7 +178,7 @@ module internal Parse =
let rec digitsPosition n pos =
if pos >= len then failwith (FSComp.SR.forBadPrecision())
match fmt[pos] with
| c when System.Char.IsDigit c -> digitsPosition (n*10 + int c - int '0') (pos+1)
| c when isDigit c -> digitsPosition (n*10 + int c - int '0') (pos+1)
| '$' -> Some n, pos+1
| _ -> None, pos

Expand Down Expand Up @@ -371,7 +371,7 @@ let parseFormatStringInternal
// type checker. They should always have '(...)' after for format string.
let requireAndSkipInterpolationHoleFormat i =
if i < len && fmt[i] = '(' then
let i2 = fmt.IndexOfOrdinal(")", i+1)
let i2 = fmt.IndexOf(')', i+1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not ordinal here?

Copy link
Author

@OwnageIsMagic OwnageIsMagic Dec 21, 2023

Choose a reason for hiding this comment

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

char overloads are always Ordinal. My PR is larger than #16439 (that introduced IndexOfOrdinal ext method) and established usage of char overload.
+ potentially it's faster on netfx (on Core they both delegated to the same Span function)

Copy link
Author

Choose a reason for hiding this comment

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

if i2 = -1 then
failwith (FSComp.SR.forFormatInvalidForInterpolated3())
else
Expand Down
32 changes: 16 additions & 16 deletions src/Compiler/Checking/NameResolution.fs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ type Item =
| ValueSome tcref -> tcref.DisplayNameCore
| _ -> nm
|> DemangleGenericTypeName
| Item.CtorGroup(nm, _) -> nm |> DemangleGenericTypeName
| Item.CtorGroup(nm, _) -> nm |> DemangleGenericTypeName
| Item.DelegateCtor ty ->
match ty with
| AbbrevOrAppTy(tcref, _) -> tcref.DisplayNameCore
Expand Down Expand Up @@ -2730,14 +2730,14 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf
| None -> success [resInfo, x, rest]
| Some _argExpr ->
// RFC-1137 prefer extension method when ...

let ignoreProperty (p: PropInfo) =
// do not hide properties if:
// * is indexed property e.g.:
// ```fsharp
// member x.Prop with
// member x.Prop with
// get (indexPiece1:int,indexPiece2: string) = ...
// and set (indexPiece1:int,indexPiece2: string) value = ...
// and set (indexPiece1:int,indexPiece2: string) value = ...
// ```
// which is called like this: obj.Prop(1,"a") or obj.Prop(1,"a") <- someValue
// * is function type e.g.:
Expand All @@ -2753,7 +2753,7 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf
| TType_var(typar={typar_solution = Some (TType_fun _) }) ->
true
| _ -> false

match x with
| Item.Property(info=ps) when ps |> List.exists ignoreProperty ->
success [resInfo, x, rest]
Expand All @@ -2768,7 +2768,7 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf
| None ->
// todo: consider if we should check extension method, but we'd probably won't have matched
// `Some(PropertyItem psets) when isLookUpExpr` in the first place.
raze (UndefinedName (depth, FSComp.SR.undefinedNameFieldConstructorOrMember, id, NoSuggestions))
raze (UndefinedName (depth, FSComp.SR.undefinedNameFieldConstructorOrMember, id, NoSuggestions))

| Some(MethodItem msets) when isLookUpExpr ->
let minfos = msets |> ExcludeHiddenOfMethInfos g ncenv.amap m
Expand Down Expand Up @@ -3198,7 +3198,7 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified
addToBuffer modref.DisplayName

// check if the user forgot to use qualified access
for e in nenv.eTyconsByDemangledNameAndArity do
for e in nenv.eTyconsByDemangledNameAndArity do
let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute e.Value.Attribs
if hasRequireQualifiedAccessAttribute then
if e.Value.IsUnionTycon && e.Value.UnionCasesArray |> Array.exists (fun c -> c.LogicalName = id.idText) then
Expand Down Expand Up @@ -4134,7 +4134,7 @@ type AfterResolution =
// maybeAppliedArgExpr is used in context of resolving extension method that would override property name, it may contain argExpr coming from the DelayedApp(argExpr: SynExpr)
// see RFC-1137
let ResolveLongIdentAsExprAndComputeRange (sink: TcResultsSink) (ncenv: NameResolver) wholem ad nenv typeNameResInfo lid (maybeAppliedArgExpr: SynExpr option) =
match ResolveExprLongIdent sink ncenv wholem ad nenv typeNameResInfo lid maybeAppliedArgExpr with
match ResolveExprLongIdent sink ncenv wholem ad nenv typeNameResInfo lid maybeAppliedArgExpr with
| Exception e -> Exception e
| Result (tinstEnclosing, item1, rest) ->
let itemRange = ComputeItemRange wholem lid rest
Expand Down Expand Up @@ -4531,7 +4531,7 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso
if methsWithStaticParams.IsEmpty then minfos
else minfos |> List.filter (fun minfo ->
let nm = minfo.LogicalName
not (nm.Contains "," && methsWithStaticParams |> List.exists (nm.StartsWithOrdinal)))
not (nm.Contains ',' && methsWithStaticParams |> List.exists nm.StartsWithOrdinal))
#endif

minfos
Expand Down Expand Up @@ -4737,7 +4737,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv is
| [] ->
let tycons =
mty.TypeDefinitions |> List.filter (fun tcref ->
not (tcref.LogicalName.Contains ",") &&
not (tcref.LogicalName.Contains ',') &&
not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tcref)))

// Collect up the accessible values in the module, excluding the members
Expand Down Expand Up @@ -4865,7 +4865,7 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE
let tycons =
nenv.TyconsByDemangledNameAndArity(fullyQualified).Values
|> Seq.filter (fun tcref ->
not (tcref.LogicalName.Contains ",") &&
not (tcref.LogicalName.Contains ',') &&
not tcref.IsFSharpException &&
not (IsTyconUnseen ad g ncenv.amap m tcref))
|> Seq.map (ItemOfTyconRef ncenv m)
Expand Down Expand Up @@ -4945,7 +4945,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForRecordFields (ncenv: NameRe
let tycons =
mty.TypeDefinitions
|> List.filter (fun tcref ->
not (tcref.LogicalName.Contains ",") &&
not (tcref.LogicalName.Contains ',') &&
tcref.IsRecordTycon &&
not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tcref)))

Expand Down Expand Up @@ -5019,7 +5019,7 @@ and ResolvePartialLongIdentToClassOrRecdFieldsImpl (ncenv: NameResolver) (nenv:
let recdTyCons =
nenv.TyconsByDemangledNameAndArity(fullyQualified).Values
|> Seq.filter (fun tcref ->
not (tcref.LogicalName.Contains ",") &&
not (tcref.LogicalName.Contains ',') &&
tcref.IsRecordTycon &&
not (IsTyconUnseen ad g ncenv.amap m tcref))
|> Seq.map (ItemOfTyconRef ncenv m)
Expand Down Expand Up @@ -5223,7 +5223,7 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty (
if methsWithStaticParams.IsEmpty then minfos
else minfos |> List.filter (fun minfo ->
let nm = minfo.LogicalName
not (nm.Contains "," && methsWithStaticParams |> List.exists (nm.StartsWithOrdinal)))
not (nm.Contains ',' && methsWithStaticParams |> List.exists nm.StartsWithOrdinal))
#endif

minfos
Expand Down Expand Up @@ -5341,7 +5341,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver)
let tycons =
mty.TypeDefinitions
|> List.filter (fun tcref ->
not (tcref.LogicalName.Contains ",") &&
not (tcref.LogicalName.Contains ',') &&
not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tcref)))

// Get all the types and .NET constructor groups accessible from here
Expand Down Expand Up @@ -5415,7 +5415,7 @@ let rec GetCompletionForItem (ncenv: NameResolver) (nenv: NameResolutionEnv) m a
| Item.Types _ ->
for tcref in nenv.TyconsByDemangledNameAndArity(OpenQualified).Values do
if not tcref.IsFSharpException
&& not (tcref.LogicalName.Contains ",")
&& not (tcref.LogicalName.Contains ',')
&& not (IsTyconUnseen ad g ncenv.amap m tcref)
then yield ItemOfTyconRef ncenv m tcref

Expand Down
8 changes: 4 additions & 4 deletions src/Compiler/Checking/NicePrint.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module internal PrintUtilities =
let isDiscard (name: string) = name.StartsWithOrdinal("_")

let ensureFloat (s: string) =
if String.forall (fun c -> Char.IsDigit c || c = '-') s then
if String.forall (fun c -> isDigit c || c = '-') s then
s + ".0"
else s

Expand Down Expand Up @@ -925,7 +925,7 @@ module PrintTypes =
if not denv.includeStaticParametersInTypeNames then
None, args
else
let regex = System.Text.RegularExpressions.Regex(@"\`\d+")
let regex = System.Text.RegularExpressions.Regex(@"\`\d+", System.Text.RegularExpressions.RegexOptions.ECMAScript)
Copy link
Contributor

Choose a reason for hiding this comment

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

Haven't seen this yet - which of course doesn't mean this is not a valid change - just wondering, is this a recommendation from Microsoft or, in other words, what is it consistent with?

Copy link
Author

Choose a reason for hiding this comment

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

See notes in OP.
By default Regex is Unicode aware, so char classes maps to Unicode categories and allow much more then expected here ASCII chars.

Copy link
Contributor

@brianrourkeboll brianrourkeboll Jan 19, 2024

Choose a reason for hiding this comment

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

Instead of a regular expression, this could also just be something like:

let tryGetTyparCount (s: string) =
    let indexOfBacktick = s.LastIndexOf '`'
    if indexOfBacktick >= 0 && indexOfBacktick < s.Length - 1 then
        match Int32.TryParse(s.AsSpan(indexOfBacktick + 1)) with
        | true, genericArgCount -> ValueSome genericArgCount
        | false, _ -> ValueNone
    else
        ValueNone

let path, skip =
(0, tc.CompilationPath.DemangledPath)
||> List.mapFold (fun skip path ->
Expand Down Expand Up @@ -1962,7 +1962,7 @@ module TastDefinitionPrinting =
not (impliedNames.Contains minfo.DisplayName) &&
IsMethInfoAccessible amap m ad minfo &&
// Discard method impls such as System.IConvertible.ToBoolean
not (minfo.IsILMethod && minfo.DisplayName.Contains(".")) &&
not (minfo.IsILMethod && minfo.DisplayName.Contains('.')) &&
not minfo.IsUnionCaseTester &&
not (minfo.DisplayName.Split('.') |> Array.exists isDiscard))

Expand Down Expand Up @@ -2440,7 +2440,7 @@ module InferredSigPrinting =
| TMDefLet(bind, _) ->
([bind.Var]
|> List.filter filterVal
|> List.map (mkLocalValRef >> PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader)
|> List.map (mkLocalValRef >> PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader)
|> aboveListL)

| TMDefOpens _ -> emptyL
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/DependencyManager/DependencyProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ type DependencyProvider
path: string
) : string MaybeNull * IDependencyManagerProvider MaybeNull =
try
if path.Contains ":" && not (Path.IsPathRooted path) then
if path.Contains ':' && not (Path.IsPathRooted path) then
let managers =
RegisteredDependencyManagers compilerTools (Option.ofString outputDir) reportError

Expand Down
12 changes: 6 additions & 6 deletions src/Compiler/Driver/CompilerConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ let GetWarningNumber (m, warningNumber: string) =
// #pragma strips FS of the #pragma "FS0004" and validates the warning number
// therefore if we have warning id that starts with a numeric digit we convert it to Some (int32)
// anything else is ignored None
if Char.IsDigit(warningNumber[0]) then
if isDigit (warningNumber[0]) then
Some(int32 warningNumber)
elif warningNumber.StartsWithOrdinal "FS" then
raise (ArgumentException())
Expand Down Expand Up @@ -274,11 +274,11 @@ type AssemblyReference =
member x.ProjectReference = (let (AssemblyReference(_, _, contents)) = x in contents)

member x.SimpleAssemblyNameIs name =
(String.Compare(FileSystemUtils.fileNameWithoutExtensionWithValidate false x.Text, name, StringComparison.OrdinalIgnoreCase) = 0)
|| not (x.Text.Contains "/")
&& not (x.Text.Contains "\\")
&& not (x.Text.EndsWith(".dll", StringComparison.InvariantCultureIgnoreCase))
&& not (x.Text.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase))
String.Equals(FileSystemUtils.fileNameWithoutExtensionWithValidate false x.Text, name, StringComparison.OrdinalIgnoreCase)
|| not (x.Text.Contains '/')
&& not (x.Text.Contains '\\')
&& not (x.Text.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
&& not (x.Text.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
&& (try
let aname = System.Reflection.AssemblyName x.Text in aname.Name = name
with _ ->
Expand Down
17 changes: 4 additions & 13 deletions src/Compiler/Driver/CompilerImports.fs
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,11 @@ let isHashRReference (r: range) =
&& not (equals r rangeCmdArgs)
&& FileSystem.IsPathRootedShim r.FileName

let IsNetModule fileName =
let ext = Path.GetExtension fileName
String.Compare(ext, ".netmodule", StringComparison.OrdinalIgnoreCase) = 0
let IsNetModule (fileName: string) = fileName.EndsWithOrdinalIgnoreCase ".netmodule"

let IsDLL fileName =
let ext = Path.GetExtension fileName
String.Compare(ext, ".dll", StringComparison.OrdinalIgnoreCase) = 0
let IsDLL (fileName: string) = fileName.EndsWithOrdinalIgnoreCase ".dll"

let IsExe fileName =
let ext = Path.GetExtension fileName
String.Compare(ext, ".exe", StringComparison.OrdinalIgnoreCase) = 0
let IsExe (fileName: string) = fileName.EndsWithOrdinalIgnoreCase ".exe"

let addConstraintSources(ia: ImportedAssembly) =
let contents = ia.FSharpViewOfMetadata.Contents
Expand Down Expand Up @@ -2403,10 +2397,7 @@ and [<Sealed>] TcImports
|> List.tryFind (fun dll ->
let baseName = Path.GetFileNameWithoutExtension(dll.resolvedPath)

let res =
String.Compare(baseName, tcConfig.primaryAssembly.Name, StringComparison.OrdinalIgnoreCase)

res = 0)
String.Equals(baseName, tcConfig.primaryAssembly.Name, StringComparison.OrdinalIgnoreCase))

match path with
| Some p -> AssemblyReference(range0, p.resolvedPath, None)
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Driver/CompilerOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ let DumpCompilerOptionBlocks blocks =
List.iter dumpCompilerOptionBlock blocks

let isSlashOpt (opt: string) =
opt[0] = '/' && (opt.Length = 1 || not (opt[1..].Contains "/"))
opt[0] = '/' && (opt.Length = 1 || not (opt[1..].Contains '/'))

module ResponseFile =

Expand Down
Loading