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

Commit2d8ebcd

Browse files
antofikunknown
authored and
unknown
committed
XmlDoc generation bugfix: remove duplicate namespaces
1 parent8ea584c commit2d8ebcd

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

‎src/fsharp/fsc.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ module XmlDocWriter =
608608
for ucin tc.UnionCasesAsListdo
609609
if(hasDoc uc.XmlDoc)then uc.XmlDocSig<- XmlDocSigOfUnionCase ptext uc.Id.idText tc.CompiledName
610610
for rfin tc.AllFieldsAsListdo
611-
if(hasDoc rf.XmlDoc)then rf.XmlDocSig<- XmlDocSigOfField ptext rf.Id.idText(iftc.IsEnumTyconthen tc.CompiledNameelse tc.CompiledRepresentationForNamedType.Name)
611+
if(hasDoc rf.XmlDoc)then rf.XmlDocSig<- XmlDocSigOfField ptext rf.Id.idText tc.CompiledName
612612

613613
letdoModuleMemberSig path(m:ModuleOrNamespace)= m.XmlDocSig<- XmlDocSigOfSubModul path
614614
(* moduleSpec - recurses*)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SOURCE=xmlDoc001.fs SCFLAGS="-r:System.Xml.dll --doc:xmlDoc001.xml --define:WITHXMLVERIFICATION"# xmlDoc001.fs
22
SOURCE=xmlDoc002.fs SCFLAGS="-r:System.Xml.dll --doc:xmlDoc002.xml --define:WITHXMLVERIFICATION"# xmlDoc002.fs
33
SOURCE=xmlDoc003.fs SCFLAGS="-r:System.Xml.dll --doc:xmlDoc003.xml --define:WITHXMLVERIFICATION"# xmlDoc003.fs
4+
SOURCE="xmlDoc004.fsx xmlDoc004.fs" SCFLAGS="-r:System.Xml.dll --doc:xmlDoc004.xml --define:WITHXMLVERIFICATION"# xmlDoc004.fs
45
SOURCE=XMLDocOnEnum01.fs SCFLAGS="-r:System.Xml.dll --doc:XMLDocOnEnum01.xml --define:WITHXMLVERIFICATION"# XMLDocOnEnum01.fs
56

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// #Regression #XMLDoc
2+
// This used to be regression test for FSHARP1.0:850
3+
// Verify that XmlDoc name is correctly generated
4+
//<Expects status=success></Expects>
5+
6+
#light
7+
8+
openSystem.Xml
9+
openMyRather.MyDeep.MyNamespace
10+
11+
letcheck(xml:XmlDocument)name xmlDoc=
12+
xmlDoc=((xml.SelectSingleNode("/doc/members/member[@name='"+ name+"']")).SelectSingleNode"summary").InnerText.Trim()
13+
lettest=
14+
letmyname= System.Reflection.Assembly.GetExecutingAssembly().Location
15+
letxmlname= System.IO.Path.ChangeExtension(myname,"xml")
16+
17+
18+
#if WITHXMLVERIFICATION
19+
letxml=new XmlDocument()
20+
xml.Load xmlname
21+
if check xml"T:MyRather.MyDeep.MyNamespace.TestEnum.VALUE2""enumValue2"
22+
&& check xml"T:MyRather.MyDeep.MyNamespace.TestEnum""test enum"
23+
&& check xml"F:MyRather.MyDeep.MyNamespace.TestRecord.MyProperpty""Record string"
24+
&& check xml"T:MyRather.MyDeep.MyNamespace.TestRecord""testRecord"
25+
&& check xml"M:MyRather.MyDeep.MyNamespace.myModule.testAnd(System.Boolean,System.Boolean)""my function"
26+
&& check xml"P:MyRather.MyDeep.MyNamespace.myModule.myVariable""integer value"
27+
&& check xml"T:MyRather.MyDeep.MyNamespace.myModule""my module comment"
28+
then0else1
29+
#else
30+
0
31+
#endif
32+
33+
test|> exit
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// #Regression #XMLDoc
2+
// This used to be regression test for FSHARP1.0:850
3+
// Verify that XmlDoc name is correctly generated
4+
//<Expects status=success></Expects>
5+
6+
#light
7+
8+
///mynamespace
9+
namespaceMyRather.MyDeep.MyNamespace
10+
///testRecord
11+
typeTestRecord={
12+
/// Record string
13+
MyProperpty:string
14+
}
15+
16+
///test enum
17+
typeTestEnum= VALUE1
18+
///enumValue2
19+
| VALUE2
20+
21+
///my module comment
22+
modulemyModule=
23+
///integer value
24+
letmyVariable=4;
25+
26+
///my function
27+
lettestAnd x y=
28+
///inner match
29+
match x, ywith
30+
|true,true->true
31+
|_->false;;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp