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

Commitc5e6699

Browse files
dsymelatkin
authored andcommitted
fix for private val set
fixesdotnet#27resolvesdotnet#28commit bf3c9b3ff6151a09dd9319e5e54d21a0edd17c31Merge:5eb06577393d92Author: latkin <latkin@microsoft.com>Date: Mon Jan 19 16:57:58 2015 -0800 Merge branch 'private-val-fix' ofhttps://github.com/dsyme/visualfsharp into dsyme-private-val-fixcommit7393d92Author: Don Syme <dsyme@microsoft.com>Date: Sat Jan 17 11:50:54 2015 +0000 add tests for val setscommit68555a3Author: Don Syme <dsyme@microsoft.com>Date: Sat Jan 17 11:38:18 2015 +0000 adjust range reported in errorcommitbff938fAuthor: Don Syme <dsyme@microsoft.com>Date: Sat Jan 17 11:35:08 2015 +0000 fix compilecommitd2f12e4Author: Don Syme <dsyme@microsoft.com>Date: Sat Jan 17 11:33:41 2015 +0000 fix for private val set
1 parent5eb0657 commitc5e6699

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

‎src/fsharp/tc.fs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8146,6 +8146,9 @@ and TcItemThen cenv overallTy env tpenv (item,mItem,rest,afterOverloadResolution
81468146
| DelayedSet(e2,mStmt) :: otherDelayed ->
81478147
if nonNil otherDelayed then error(Error(FSComp.SR.tcInvalidAssignment(),mStmt))
81488148
UnifyTypes cenv env mStmt overallTy cenv.g.unit_ty
8149+
vref.Deref.SetHasBeenReferenced()
8150+
CheckValAccessible mItem env.eAccessRights vref
8151+
CheckValAttributes cenv.g vref mItem |> CommitOperationResult
81498152
let vty = vref.Type
81508153
let vty2 =
81518154
if isByrefTy cenv.g vty then

‎tests/fsharp/typecheck/sigs/neg91.bsl‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@
22
neg91.fs(7,16,7,30): typecheck error FS0896: Enumerations cannot have members
33

44
neg91.fs(10,10,10,15): typecheck error FS0956: Members that extend interface, delegateor enum types must be placedin a module separateto the definition of the type. This module must either have the AutoOpen attributeor be opened explicitly by client codeto bring the extension members into scope.
5+
6+
neg91.fs(24,13,24,16): typecheck error FS1094: The value 'x' isnot accessible from this code location
7+
8+
neg91.fs(34,13,34,16): typecheck error FS0044: This construct is deprecated. Don't touch me
9+
10+
neg91.fs(44,13,44,16): typecheck error FS3003: Don't touch me
11+
12+
neg91.fs(54,13,54,16): typecheck error FS0057: It was just an experiment!. This warning can be disabled using '--nowarn:57'or '#nowarn"57"'.

‎tests/fsharp/typecheck/sigs/neg91.fs‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,44 @@ module T2 =
1212
typeEnum2
1313
with
1414
memberthis.Foo()=1// not ok
15+
16+
moduleTestPrivateSet=
17+
// See https://github.com/Microsoft/visualfsharp/issues/27
18+
moduleA=
19+
let mutableprivatex=0
20+
21+
moduleB=
22+
lettest()=
23+
// let _ = A.x // accessibility error on read, as expected
24+
A.x<-1// but write works!
25+
26+
moduleTestObsoleteSet=
27+
// See https://github.com/Microsoft/visualfsharp/issues/27
28+
moduleA=
29+
[<System.ObsoleteAttribute("Don't touch me")>]
30+
let mutablex=0
31+
32+
moduleB=
33+
lettest()=
34+
A.x<-1
35+
36+
moduleTestCompilerMessgeSet=
37+
// See https://github.com/Microsoft/visualfsharp/issues/27
38+
moduleA=
39+
[<CompilerMessageAttribute("Don't touch me",3003)>]
40+
let mutablex=0
41+
42+
moduleB=
43+
lettest()=
44+
A.x<-1
45+
46+
moduleTestExperimentalSet=
47+
// See https://github.com/Microsoft/visualfsharp/issues/27
48+
moduleA=
49+
[<ExperimentalAttribute("It was just an experiment!")>]
50+
let mutablex=0
51+
52+
moduleB=
53+
lettest()=
54+
A.x<-1
55+

‎tests/test.lst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,6 @@ Misc02fsharp\regression\tuple-bug-1
179179
Misc02fsharp\tools\bundle
180180
Misc02fsharp\tools\eval
181181
Misc02..\testsprivate\fsharp\tools\queries
182-
Misc02fsharp\typecheck\misc
183-
Misc02fsharp\typecheck\sigs
184-
Misc02fsharp\typecheck\full-rank-arrays
182+
Misc02,TypeCheckerfsharp\typecheck\misc
183+
Misc02,TypeCheckerfsharp\typecheck\sigs
184+
Misc02,TypeCheckerfsharp\typecheck\full-rank-arrays

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp