Skip to content

Commit

Permalink
add tests for val sets
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyme committed Jan 17, 2015
1 parent 68555a3 commit 7393d92
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
8 changes: 8 additions & 0 deletions tests/fsharp/typecheck/sigs/neg91.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@
neg91.fs(7,16,7,30): typecheck error FS0896: Enumerations cannot have members

neg91.fs(10,10,10,15): typecheck error FS0956: Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope.

neg91.fs(24,13,24,16): typecheck error FS1094: The value 'x' is not accessible from this code location

neg91.fs(34,13,34,16): typecheck error FS0044: This construct is deprecated. Don't touch me

neg91.fs(44,13,44,16): typecheck error FS3003: Don't touch me

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"'.
41 changes: 41 additions & 0 deletions tests/fsharp/typecheck/sigs/neg91.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,44 @@ module T2 =
type Enum2
with
member this.Foo() = 1 // not ok

module TestPrivateSet =
// See https://github.com/Microsoft/visualfsharp/issues/27
module A =
let mutable private x = 0

module B =
let test () =
// let _ = A.x // accessibility error on read, as expected
A.x <- 1 // but write works!

module TestObsoleteSet =
// See https://github.com/Microsoft/visualfsharp/issues/27
module A =
[<System.ObsoleteAttribute("Don't touch me")>]
let mutable x = 0

module B =
let test () =
A.x <- 1

module TestCompilerMessgeSet =
// See https://github.com/Microsoft/visualfsharp/issues/27
module A =
[<CompilerMessageAttribute("Don't touch me", 3003)>]
let mutable x = 0

module B =
let test () =
A.x <- 1

module TestExperimentalSet =
// See https://github.com/Microsoft/visualfsharp/issues/27
module A =
[<ExperimentalAttribute("It was just an experiment!")>]
let mutable x = 0

module B =
let test () =
A.x <- 1

6 changes: 3 additions & 3 deletions tests/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,6 @@ Misc02 fsharp\regression\tuple-bug-1
Misc02 fsharp\tools\bundle
Misc02 fsharp\tools\eval
Misc02 ..\testsprivate\fsharp\tools\queries
Misc02 fsharp\typecheck\misc
Misc02 fsharp\typecheck\sigs
Misc02 fsharp\typecheck\full-rank-arrays
Misc02,TypeChecker fsharp\typecheck\misc
Misc02,TypeChecker fsharp\typecheck\sigs
Misc02,TypeChecker fsharp\typecheck\full-rank-arrays

0 comments on commit 7393d92

Please sign in to comment.