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

Commit385ee63

Browse files
dsymeKevinRansom
authored andcommitted
Fix compiler crash (#3524)
1 parent02b8e09 commit385ee63

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

‎src/fsharp/tast.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3539,14 +3539,14 @@ and
35393539
memberx.GetAssemblyName()=
35403540
match xwith
35413541
| TType_forall(_tps, ty)-> ty.GetAssemblyName()
3542-
| TType_app(tcref,_tinst)-> tcref.CompilationPath.ILScopeRef.AssemblyRef.QualifiedName
3542+
| TType_app(tcref,_tinst)-> tcref.CompilationPath.ILScopeRef.QualifiedName
35433543
| TType_tuple(_tupInfo,_tinst)->""
35443544
| TType_fun(_d,_r)->""
35453545
| TType_measure_ms->""
35463546
| TType_var tp-> tp.Solution|>function Some sln-> sln.GetAssemblyName()| None->""
35473547
| TType_ucase(_uc,_tinst)->
35483548
let(TILObjectReprData(scope,_nesting,_definition))=_uc.Tycon.ILTyconInfo
3549-
scope.AssemblyRef.QualifiedName
3549+
scope.QualifiedName
35503550

35513551
andTypeInst= TType list
35523552
andTTypes= TType list

‎tests/fsharp/tests.fs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,6 +2137,9 @@ module TypecheckTests =
21372137
[<Test>]
21382138
let``type check neg98``()= singleNegTest(testConfig"typecheck/sigs")"neg98"
21392139

2140+
[<Test>]
2141+
let``type check neg99``()= singleNegTest(testConfig"typecheck/sigs")"neg99"
2142+
21402143
[<Test>]
21412144
let``type check neg_byref_1``()= singleNegTest(testConfig"typecheck/sigs")"neg_byref_1"
21422145

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
neg99.fs(19,16,19,64): typecheck error FS0077: Member constraints with the name 'op_Explicit' are given special status by the F# compiler as certain .NET types are implicitly augmented with this member. This may resultin runtime failuresif you attemptto invoke the member constraint from your own code.
3+
4+
neg99.fs(22,18,22,64): typecheck error FS0077: Member constraints with the name 'op_Explicit' are given special status by the F# compiler as certain .NET types are implicitly augmented with this member. This may resultin runtime failuresif you attemptto invoke the member constraint from your own code.
5+
6+
neg99.fs(25,39,25,43): typecheck error FS0043: The type 'CrashFSC.OhOh.MyByte' doesnot support a conversionto the type 'CrashFSC.OhOh.MyByte'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespaceCrashFSC
2+
3+
openSystem
4+
5+
// debatable code, but it was the minimalist example I could come up
6+
// with after analysis in the original project
7+
moduleOhOh=
8+
9+
typeMyByte= MyByteofbytewith
10+
static member inlineop_Explicit(MyByte x):int64= int64 x
11+
static member inlineop_Explicit(MyByte x):double= double x
12+
13+
static member inlineop_Explicit(x:int64):MyByte= MyByte(byte x)
14+
static member inlineop_Explicit(x:float):MyByte= MyByte(byte x)
15+
static member inlineop_Explicit(MyByte x):'a= failwith"cannot convert"
16+
17+
/// testing testing
18+
let inline(!>>>)(a:^a)min:^b option=
19+
if a<(^b:(static memberop_Explicit:^b->^a) min)
20+
then None
21+
else
22+
Some(^b:(static memberop_Explicit:^a->^b) a)
23+
24+
let inlinecrashMe(a:^a)min=
25+
let(result:MyByte option)=!>>> a min
26+
result

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp