forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combining struct field with units of measure will result managed type…
… instead of unmanaged type fixes dotnet#276 closes dotnet#289 commit 843272178d4369d1fc028ea46956fb669242c212 Author: latkin <latkin@microsoft.com> Date: Tue Mar 10 11:19:54 2015 -0700 Add test covering original bug commit 4d194c4 Author: andrewjkennedy <akenn@microsoft.com> Date: Mon Mar 2 13:13:27 2015 +0000 Fix for dotnet#276: Combining struct field with units of measure will result managed type instead of unmanaged type (Regression test to follow)
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// test covering https://github.com/Microsoft/visualfsharp/issues/276 | ||
|
||
open FSharp.Data.UnitSystems.SI.UnitSymbols | ||
|
||
[<Struct>] | ||
type S1 = | ||
val X: int | ||
|
||
[<Struct>] | ||
type S2 = | ||
val X: int<m> | ||
|
||
let f (x : 'T when 'T: unmanaged and 'T: struct) = printfn "%A" x | ||
|
||
f (S1()) | ||
f (S2()) // previously had error FS0001: A generic construct requires that the type 'S2' is an unmanaged type |