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

Commit4267370

Browse files
committed
Fixesdotnet#9, Internal error in FSI: FS0192: binding null type in envBindTypeRefdotnet#9
Fixesdotnet#10, internal error: binding null type in envBindTypeRefBoth issues were caused by the same underlying issue. RefEmit automagically applies escaping to names that contain a ',' So ``,`` becomes ``\,``. When we tried to create a ref to a nested type we didn't add the ',' escaping so we couldnot bind to the created type.The fix is very straightforward, change BasicQualifiedName to correctly escape names with comma's.
1 parentc651690 commit4267370

File tree

3 files changed

+85
-2
lines changed

3 files changed

+85
-2
lines changed

‎src/absil/il.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,8 @@ type ILTypeRef =
678678

679679
membertref.FullName= String.concat"."(tref.Enclosing@[tref.Name])
680680

681-
membertref.BasicQualifiedName=
682-
String.concat"+"(tref.Enclosing@[ tref.Name])
681+
membertref.BasicQualifiedName=
682+
(String.concat"+"(tref.Enclosing@[ tref.Name])).Replace(",",@"\,")
683683

684684
membertref.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)=
685685
letsco= tref.Scope.QualifiedNameWithNoShortPrimaryAssembly
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
//<Expects status=success></Expects>
2+
openSystem
3+
openSystem.Reflection
4+
5+
openMicrosoft.FSharp.Quotations
6+
openMicrosoft.FSharp.Quotations.Patterns
7+
openMicrosoft.FSharp.Quotations.DerivedPatterns
8+
9+
letfailures= reffalse
10+
letreport_failure()=
11+
stderr.WriteLine" NO"; failures:=true
12+
lettest s b= stderr.Write(s:string);if bthen stderr.WriteLine" OK"else report_failure()
13+
14+
(*--------------------*)
15+
16+
// Test cases for Github Issue # 10 module cannot contain ,
17+
18+
// Comma in module name
19+
module``,`` =
20+
letx=3
21+
22+
// Lots of comma's in module name
23+
module``,,,,,,,,,,,`` =
24+
letx=5
25+
26+
// Lots of comma's and other characters in module name
27+
module``One,2, Three,4, Five``=
28+
letx=7
29+
30+
// Nested modules with commas
31+
module``Nestedmoduleswith commas``=
32+
module``One,``=
33+
module``Two,``=
34+
module``Three,``=
35+
letx=9
36+
37+
module``Commaintypename``=
38+
type``,``=
39+
static memberx=13
40+
41+
// Lots of comma's in type name
42+
module``Lotsofcomma'sintypename``=
43+
type``,,,,,,,``=
44+
static memberx=15
45+
46+
// Lots of comma's and other characters in type name
47+
module``Lotsofcomma'sandothercharactersintypename``=
48+
type``One, 2, Three, 4, Five``=
49+
static memberx=17
50+
51+
do
52+
leteval expr value=if(expr)= valuethentrueelsefalse
53+
54+
test"Comma in module name"(eval``,``.x3)
55+
test"Lots of comma's in module name"(eval``,,,,,,,,,,,``.x5)
56+
test"Lots of comma's and other characters in module name"(eval``One, 2, Three, 4, Five``.x7)
57+
test"Nested modules with commas"(eval``Nested modules with commas``.``One,``.``Two,``.``Three,``.x9)
58+
59+
test"Comma in type name"(eval``Comma in type name``.``,``.x13)
60+
test"Lots of comma's in type name"(eval``Lots of comma's in type name``.``,,,,,,,``.x15)
61+
test"Lots of comma's and other characters in type name"(eval``Lots of comma's and other characters in type name``.``One, 2, Three, 4, Five``.x17)
62+
63+
leteval expr value=(match exprwith| PropertyGet(a, b, c)->(if(b.GetGetMethod(true):> MethodBase).Invoke(null,null):?>int= valuethentrueelsefalse)|_->false)
64+
65+
test"Comma in module name from quotation"(eval<@@``,``.x@@>3)
66+
test"Lots of comma's in module name from quotation"(eval<@@``,,,,,,,,,,,``.x@@>5)
67+
test"Lots of comma's and other characters in module name from quotation"(eval<@@``One, 2, Three, 4, Five``.x@@>7)
68+
test"Nested modules with commas from quotation"(eval<@@``Nested modules with commas``.``One,``.``Two,``.``Three,``.x@@>9)
69+
70+
test"Comma in type name from quotation"(eval<@@``Comma in type name``.``,``.x@@>13)
71+
test"Lots of comma's in type name from quotation"(eval<@@``Lots of comma's in type name``.``,,,,,,,``.x@@>15)
72+
test"Lots of comma's and other characters in type name from quotation"(eval<@@``Lots of comma's and other characters in type name``.``One, 2, Three, 4, Five``.x@@>17)
73+
74+
letaa=
75+
if!failuresthen(stdout.WriteLine"Test Failed"; exit1)
76+
77+
do(stdout.WriteLine"Test Passed";
78+
System.IO.File.WriteAllText("test.ok","ok");
79+
exit0)

‎tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/env.lst‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
SOURCE=E_KeywordIdent01.fs# E_KeywordIdent01.fs
1010
SOURCE=E_ValidIdentifier03.fs SCFLAGS="--test:ErrorRanges"# E_ValidIdentifier03.fs
1111
SOURCE=E_ValidIdentifier04.fs# E_ValidIdentifier04.fs
12+
13+
SOURCE=backtickmoduleandtypenames.fsx# backtickmoduleandtypenames.fsx
14+
SOURCE=backtickmoduleandtypenames.fsx FSIMODE=EXEC COMPILE_ONLY=1 # backtickmoduleandtypenames.fsx FSIMODE=EXEC COMPILE_ONLY=1
15+
1216
SOURCE=StructNotAllowDoKeyword.fs# StructNotAllowDoKeyword.fs
1317
SOURCE=E_MissingQualification.fs SCFLAGS="--test:ErrorRanges"# E_MissingQualification.fs
1418

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp