Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33ea3e2

Browse files
authored
Merge pull requestdotnet#4615 from Microsoft/merges/master-to-dev15.7
Merge master to dev15.7
2 parentsd966d6d +707e712 commit33ea3e2

31 files changed

+242
-75
lines changed

‎src/fsharp/CompileOps.fs‎

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ let GetRangeOfDiagnostic(err:PhasedDiagnostic) =
154154
| InterfaceNotRevealed(_,_, m)
155155
| WrappedError(_, m)
156156
| PatternMatchCompilation.MatchIncomplete(_,_, m)
157+
| PatternMatchCompilation.EnumMatchIncomplete(_,_, m)
157158
| PatternMatchCompilation.RuleNeverMatched m
158159
| ValNotMutable(_,_, m)
159160
| ValNotLocal(_,_, m)
@@ -355,6 +356,7 @@ let GetDiagnosticNumber(err:PhasedDiagnostic) =
355356
| ExtensionTyping.ProvidedTypeResolutionNoRange_
356357
| ExtensionTyping.ProvidedTypeResolution_->103
357358
#endif
359+
| PatternMatchCompilation.EnumMatchIncomplete_->104
358360
(* DO NOT CHANGE THE NUMBERS*)
359361

360362
// Strip TargetInvocationException wrappers
@@ -560,6 +562,7 @@ let MatchIncomplete2E() = DeclareResourceString("MatchIncomplete2", "%s")
560562
letMatchIncomplete3E()= DeclareResourceString("MatchIncomplete3","%s")
561563
letMatchIncomplete4E()= DeclareResourceString("MatchIncomplete4","")
562564
letRuleNeverMatchedE()= DeclareResourceString("RuleNeverMatched","")
565+
letEnumMatchIncomplete1E()= DeclareResourceString("EnumMatchIncomplete1","")
563566
letValNotMutableE()= DeclareResourceString("ValNotMutable","%s")
564567
letValNotLocalE()= DeclareResourceString("ValNotLocal","")
565568
letObsolete1E()= DeclareResourceString("Obsolete1","")
@@ -1402,6 +1405,15 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) =
14021405
if isCompthen
14031406
os.Append(MatchIncomplete4E().Format)|> ignore
14041407

1408+
| PatternMatchCompilation.EnumMatchIncomplete(isComp, cexOpt,_)->
1409+
os.Append(EnumMatchIncomplete1E().Format)|> ignore
1410+
match cexOptwith
1411+
| None->()
1412+
| Some(cex,false)-> os.Append(MatchIncomplete2E().Format cex)|> ignore
1413+
| Some(cex,true)-> os.Append(MatchIncomplete3E().Format cex)|> ignore
1414+
if isCompthen
1415+
os.Append(MatchIncomplete4E().Format)|> ignore
1416+
14051417
| PatternMatchCompilation.RuleNeverMatched_-> os.Append(RuleNeverMatchedE().Format)|> ignore
14061418

14071419
| ValNotMutable(_, valRef,_)-> os.Append(ValNotMutableE().Format(valRef.DisplayName))|> ignore
@@ -2084,7 +2096,7 @@ type IRawFSharpAssemblyData =
20842096
abstractGetInternalsVisibleToAttributes :ILGlobals->stringlist
20852097
/// The raw IL module definition in the assembly, if any. This is not present for cross-project references
20862098
/// in the language service
2087-
abstractTryGetRawILModule :unit->ILModuleDefoption
2099+
abstractTryGetILModuleDef :unit->ILModuleDefoption
20882100
/// The raw F# signature data in the assembly, if any
20892101
abstractGetRawFSharpSignatureData :range* ilShortAssemName:string* fileName:string->(string*byte[])list
20902102
/// The raw F# optimization data in the assembly, if any
@@ -2322,9 +2334,6 @@ type TcConfigBuilder =
23222334
isInvalidationSupported:bool
23232335

23242336
/// used to log sqm data
2325-
mutable sqmSessionGuid:System.Guid option
2326-
mutable sqmNumOfSourceFiles:int
2327-
sqmSessionStartedTime:int64
23282337
23292338
/// if true - every expression in quotations will be augmented with full debug info (filename, location in file)
23302339
mutable emitDebugInfoInQuotations:bool
@@ -2472,9 +2481,6 @@ type TcConfigBuilder =
24722481
noDebugData=false
24732482
isInteractive=false
24742483
isInvalidationSupported=false
2475-
sqmSessionGuid= None
2476-
sqmNumOfSourceFiles=0
2477-
sqmSessionStartedTime= System.DateTime.UtcNow.Ticks
24782484
emitDebugInfoInQuotations=false
24792485
exename= None
24802486
copyFSharpCore= CopyFSharpCoreFlag.No
@@ -2943,9 +2949,6 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) =
29432949
memberx.isInteractive= data.isInteractive
29442950
memberx.isInvalidationSupported= data.isInvalidationSupported
29452951
memberx.emitDebugInfoInQuotations= data.emitDebugInfoInQuotations
2946-
memberx.sqmSessionGuid= data.sqmSessionGuid
2947-
memberx.sqmNumOfSourceFiles= data.sqmNumOfSourceFiles
2948-
memberx.sqmSessionStartedTime= data.sqmSessionStartedTime
29492952
memberx.copyFSharpCore= data.copyFSharpCore
29502953
memberx.shadowCopyReferences= data.shadowCopyReferences
29512954
memberx.tryGetMetadataSnapshot= data.tryGetMetadataSnapshot
@@ -3822,7 +3825,7 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR
38223825
interface IRawFSharpAssemblyDatawith
38233826
member__.GetAutoOpenAttributes(ilg)= GetAutoOpenAttributes ilg ilModule
38243827
member__.GetInternalsVisibleToAttributes(ilg)= GetInternalsVisibleToAttributes ilg ilModule
3825-
member__.TryGetRawILModule()= Some ilModule
3828+
member__.TryGetILModuleDef()= Some ilModule
38263829
member__.GetRawFSharpSignatureData(m,ilShortAssemName,filename)=
38273830
letresources= ilModule.Resources.AsList
38283831
letsigDataReaders=
@@ -4090,6 +4093,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
40904093
FileName= Some fileName
40914094
MemberSignatureEquality=(fun ty1 ty2-> Tastops.typeEquivAux EraseAll g ty1 ty2)
40924095
ImportProvidedType=(fun ty-> Import.ImportProvidedType(tcImports.GetImportMap()) m ty)
4096+
TryGetILModuleDef=(fun()-> Some ilModule)
40934097
TypeForwarders= Map.empty}
40944098

40954099
letccu= CcuThunk.Create(ilShortAssemName, ccuData)
@@ -4392,8 +4396,8 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
43924396
membertcImports.PrepareToImportReferencedILAssembly(ctok,m,filename,dllinfo:ImportedBinary)=
43934397
CheckDisposed()
43944398
lettcConfig= tcConfigP.Get(ctok)
4395-
assert dllinfo.RawMetadata.TryGetRawILModule().IsSome
4396-
letilModule= dllinfo.RawMetadata.TryGetRawILModule().Value
4399+
assert dllinfo.RawMetadata.TryGetILModuleDef().IsSome
4400+
letilModule= dllinfo.RawMetadata.TryGetILModuleDef().Value
43974401
letilScopeRef= dllinfo.ILScopeRef
43984402
letaref=
43994403
match ilScopeRefwith
@@ -4441,7 +4445,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
44414445
letccuRawDataAndInfos=
44424446
ilModule.GetRawFSharpSignatureData(m, ilShortAssemName, filename)
44434447
|> List.map(fun(ccuName,sigDataReader)->
4444-
letdata= GetSignatureData(filename, ilScopeRef, ilModule.TryGetRawILModule(), sigDataReader)
4448+
letdata= GetSignatureData(filename, ilScopeRef, ilModule.TryGetILModuleDef(), sigDataReader)
44454449

44464450
letoptDatas= Map.ofList optDataReaders
44474451

@@ -4466,6 +4470,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
44664470
IsProviderGenerated=false
44674471
ImportProvidedType=(fun ty-> Import.ImportProvidedType(tcImports.GetImportMap()) m ty)
44684472
#endif
4473+
TryGetILModuleDef= ilModule.TryGetILModuleDef
44694474
UsesFSharp20PlusQuotations= minfo.usesQuotations
44704475
MemberSignatureEquality=(fun ty1 ty2-> Tastops.typeEquivAux EraseAll(tcImports.GetTcGlobals()) ty1 ty2)
44714476
TypeForwarders= ImportILAssemblyTypeForwarders(tcImports.GetImportMap, m, ilModule.GetRawTypeForwarders())}
@@ -4479,7 +4484,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
44794484
if verbosethen dprintf"*** no optimization data for CCU%s, was DLL compiled with --no-optimization-data??\n" ccuName
44804485
None
44814486
| Some info->
4482-
letdata= GetOptimizationData(filename, ilScopeRef, ilModule.TryGetRawILModule(), info)
4487+
letdata= GetOptimizationData(filename, ilScopeRef, ilModule.TryGetILModuleDef(), info)
44834488
letres= data.OptionalFixup(fun nm-> availableToOptionalCcu(tcImports.FindCcu(ctok, m, nm, lookupOnly=false)))
44844489
if verbosethen dprintf"found optimization data for CCU%s\n" ccuName
44854490
Some res)
@@ -4496,7 +4501,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
44964501
ILScopeRef= ilScopeRef}
44974502
letphase2()=
44984503
#if!NO_EXTENSIONTYPING
4499-
match ilModule.TryGetRawILModule()with
4504+
match ilModule.TryGetILModuleDef()with
45004505
| None->()// no type providers can be used without a real IL Module present
45014506
| Some ilModule->
45024507
ccuinfo.TypeProviders<- tcImports.ImportTypeProviderExtensions(ctok, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m)
@@ -5364,6 +5369,7 @@ let GetInitialTcState(m, ccuName, tcConfig:TcConfig, tcGlobals, tcImports:TcImpo
53645369
IsProviderGenerated=false
53655370
ImportProvidedType=(fun ty-> Import.ImportProvidedType(tcImports.GetImportMap()) m ty)
53665371
#endif
5372+
TryGetILModuleDef=(fun()-> None)
53675373
FileName=None
53685374
Stamp= newStamp()
53695375
QualifiedName= None

‎src/fsharp/CompileOps.fsi‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ type IRawFSharpAssemblyData =
145145
abstractGetInternalsVisibleToAttributes:ILGlobals->stringlist
146146
/// The raw IL module definition in the assembly, if any. This is not present for cross-project references
147147
/// in the language service
148-
abstractTryGetRawILModule:unit->ILModuleDefoption
148+
abstractTryGetILModuleDef:unit->ILModuleDefoption
149149
abstractHasAnyFSharpSignatureDataAttribute:bool
150150
abstractHasMatchingFSharpSignatureDataAttribute:ILGlobals->bool
151151
/// The raw F# signature data in the assembly, if any
@@ -355,9 +355,6 @@ type TcConfigBuilder =
355355
/// If true, indicates all type checking and code generation is in the context of fsi.exe
356356
isInteractive:bool
357357
isInvalidationSupported:bool
358-
mutable sqmSessionGuid:System.Guid option
359-
mutable sqmNumOfSourceFiles:int
360-
sqmSessionStartedTime:int64
361358
mutable emitDebugInfoInQuotations:bool
362359
mutable exename:string option
363360
mutable copyFSharpCore:CopyFSharpCoreFlag
@@ -524,9 +521,6 @@ type TcConfig =
524521
/// File system query based on TcConfig settings
525522
member MakePathAbsolute: string-> string
526523

527-
member sqmSessionGuid: System.Guid option
528-
member sqmNumOfSourceFiles: int
529-
member sqmSessionStartedTime: int64
530524
member copyFSharpCore: CopyFSharpCoreFlag
531525
member shadowCopyReferences: bool
532526
static member Create: TcConfigBuilder* validate: bool-> TcConfig

‎src/fsharp/CompileOptions.fs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,16 +851,16 @@ let testFlag tcConfigB =
851851
letvsSpecificFlags(tcConfigB:TcConfigBuilder)=
852852
[ CompilerOption("vserrors", tagNone, OptionUnit(fun()-> tcConfigB.errorStyle<- ErrorStyle.VSErrors), None, None)
853853
CompilerOption("validate-type-providers", tagNone, OptionUnit(id), None, None)// preserved for compatibility's sake, no longer has any effect
854-
CompilerOption("LCID", tagInt, OptionInt(fun _n->()), None, None)
854+
CompilerOption("LCID", tagInt, OptionIntignore, None, None)
855855
CompilerOption("flaterrors", tagNone, OptionUnit(fun()-> tcConfigB.flatErrors<-true), None, None)
856-
CompilerOption("sqmsessionguid", tagNone, OptionString(fun s-> tcConfigB.sqmSessionGuid<-try System.Guid(s)|> Somewith e-> None), None, None)
856+
CompilerOption("sqmsessionguid", tagNone, OptionStringignore, None, None)
857857
CompilerOption("gccerrors", tagNone, OptionUnit(fun()-> tcConfigB.errorStyle<- ErrorStyle.GccErrors), None, None)
858858
CompilerOption("exename", tagNone, OptionString(fun s-> tcConfigB.exename<- Some(s)), None, None)
859859
CompilerOption("maxerrors", tagInt, OptionInt(fun n-> tcConfigB.maxErrors<- n), None, None)]
860860

861861
letinternalFlags(tcConfigB:TcConfigBuilder)=
862862
[
863-
CompilerOption("stamps", tagNone, OptionUnit(fun()->()), Some(InternalCommandLineOption("--stamps", rangeCmdArgs)), None)
863+
CompilerOption("stamps", tagNone, OptionUnitignore, Some(InternalCommandLineOption("--stamps", rangeCmdArgs)), None)
864864
CompilerOption("ranges", tagNone, OptionSet Tastops.DebugPrint.layoutRanges, Some(InternalCommandLineOption("--ranges", rangeCmdArgs)), None)
865865
CompilerOption("terms", tagNone, OptionUnit(fun()-> tcConfigB.showTerms<-true), Some(InternalCommandLineOption("--terms", rangeCmdArgs)), None)
866866
CompilerOption("termsfile", tagNone, OptionUnit(fun()-> tcConfigB.writeTermsToFiles<-true), Some(InternalCommandLineOption("--termsfile", rangeCmdArgs)), None)

‎src/fsharp/FSStrings.resx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,9 @@
969969
<dataname="MatchIncomplete4"xml:space="preserve">
970970
<value> Unmatched elements will be ignored.</value>
971971
</data>
972+
<dataname="EnumMatchIncomplete1"xml:space="preserve">
973+
<value>Enums may take values outside known cases.</value>
974+
</data>
972975
<dataname="RuleNeverMatched"xml:space="preserve">
973976
<value>This rule will never be matched</value>
974977
</data>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp