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

Commit9da2b33

Browse files
author
dotnet-automerge-bot
authored
Merge pull requestdotnet#5792 from Microsoft/merges/master-to-dev16.0
Merge master to dev16.0
2 parentse767f86 +1105511 commit9da2b33

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

‎src/fsharp/SignatureConformance.fs‎

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,46 +177,62 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) =
177177
|> ListSet.setify(typeEquiv g)
178178
|> List.filter(isInterfaceTy g)
179179
letaintfs= flatten aintfs
180-
letaintfsUser= flatten aintfsUser
181180
letfintfs= flatten fintfs
182181

183182
letunimpl= ListSet.subtract(fun fity aity-> typeAEquiv g aenv aity fity) fintfs aintfs
184-
(unimpl|> List.forall(fun ity-> errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleMissingInterface(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName, NicePrint.minimalStringOfType denv ity),m));false))&&
183+
(unimpl
184+
|> List.forall(fun ity->
185+
leterrorMessage= FSComp.SR.DefinitionsInSigAndImplNotCompatibleMissingInterface(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName, NicePrint.minimalStringOfType denv ity)
186+
errorR(Error(errorMessage,m));false))&&
187+
188+
letaintfsUser= flatten aintfsUser
189+
185190
lethidden= ListSet.subtract(typeAEquiv g aenv) aintfsUser fintfs
186-
letwarningOrError=if implTycon.IsFSharpInterfaceTyconthenerrorelse warning
187-
hidden|> List.iter(fun ity-> warningOrError(InterfaceNotRevealed(denv,ity,implTycon.Range)))
191+
letcontinueChecks,warningOrError=if implTycon.IsFSharpInterfaceTyconthenfalse,errorRelsetrue,warning
192+
(hidden|> List.forall(fun ity-> warningOrError(InterfaceNotRevealed(denv,ity,implTycon.Range)); continueChecks))&&
188193

189194
letaNull= IsUnionTypeWithNullAsTrueValue g implTycon
190195
letfNull= IsUnionTypeWithNullAsTrueValue g sigTycon
191196
if aNull&&not fNullthen
192-
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
197+
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
198+
false
193199
elif fNull&&not aNullthen
194-
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
200+
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
201+
false
202+
else
195203

196204
letaNull2= TypeNullIsExtraValue g m(generalizedTyconRef(mkLocalTyconRef implTycon))
197205
letfNull2= TypeNullIsExtraValue g m(generalizedTyconRef(mkLocalTyconRef implTycon))
198206
if aNull2&&not fNull2then
199207
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
208+
false
200209
elif fNull2&&not aNull2then
201210
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
211+
false
212+
else
202213

203214
letaSealed= isSealedTy g(generalizedTyconRef(mkLocalTyconRef implTycon))
204215
letfSealed= isSealedTy g(generalizedTyconRef(mkLocalTyconRef sigTycon))
205-
ifaSealed&&not fSealedthen
216+
if aSealed&&not fSealedthen
206217
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSealed(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
207-
ifnot aSealed&& fSealedthen
218+
false
219+
elifnot aSealed&& fSealedthen
208220
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
221+
false
222+
else
209223

210224
letaPartial= isAbstractTycon implTycon
211225
letfPartial= isAbstractTycon sigTycon
212226
if aPartial&&not fPartialthen
213227
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
214-
215-
ifnot aPartial&& fPartialthen
228+
false
229+
elifnot aPartial&& fPartialthen
216230
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
217-
218-
ifnot(typeAEquiv g aenv(superOfTycon g implTycon)(superOfTycon g sigTycon))then
231+
false
232+
elifnot(typeAEquiv g aenv(superOfTycon g implTycon)(superOfTycon g sigTycon))then
219233
errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m))
234+
false
235+
else
220236

221237
checkTypars m aenv implTypars sigTypars&&
222238
checkTypeRepr m aenv implTycon sigTycon.TypeReprInfo&&

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp