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

Commitc67349d

Browse files
forkiKevinRansom
authored andcommitted
Better error message for array ranks (#2637)
1 parentac3e0cc commitc67349d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

‎src/fsharp/FSComp.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ typeInfoCallsWord,"Calls"
12491249
3134,parsMutableOnAutoPropertyShouldBeGetSet,"Property definitions may not be declared mutable. To indicate that this property can be set, use 'member val PropertyName = expr with get,set'."
12501250
3135,parsMutableOnAutoPropertyShouldBeGetSetNotJustSet,"To indicate that this property can be set, use 'member val PropertyName = expr with get,set'."
12511251
3136,chkNoByrefsOfByrefs,"Type '%s' is illegal because in byref<T>, T cannot contain byref types."
1252-
3138,tastopsMaxArrayThirtyTwo,"F# supportsa maximum array rank of 32"
1252+
3138,tastopsMaxArrayThirtyTwo,"F# supportsarray ranks between 1 and 32. The value %d is not allowed."
12531253
3139,tcNoIntegerForLoopInQuery,"In queries, use the form 'for x in n .. m do ...' for ranging over integers"
12541254
3140,tcNoWhileInQuery,"'while' expressions may not be used in queries"
12551255
3141,tcNoTryFinallyInQuery,"'try/finally' expressions may not be used in queries"

‎src/fsharp/TastOps.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,7 @@ let mkByrefTy (g:TcGlobals) ty = TType_app (g.byref_tcr, [ty])
543543

544544
letmkArrayTy(g:TcGlobals)rank ty m=
545545
if rank<1|| rank>32then
546-
// TODO : Provide a better message for zero/negative inputs here.
547-
errorR(Error(FSComp.SR.tastopsMaxArrayThirtyTwo(),m));
546+
errorR(Error(FSComp.SR.tastopsMaxArrayThirtyTwo(rank),m))
548547
TType_app(g.il_arr_tcr_map.[3],[ty])
549548
else
550549
TType_app(g.il_arr_tcr_map.[rank-1],[ty])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp