提交 751f0b77 编写于 作者: W Will Smith 提交者: latkin

Inline test should use struct types

closes https://github.com/Microsoft/visualfsharp/pull/617

commit ab993583655cea2064bf87fbf368856dd91d7789
Author: TIHan <lol.tihan@gmail.com>
Date:   Tue Sep 8 13:14:31 2015 -0700

    Fixed arguments on inline test

commit 4dfd8524cda9d5f690795a5916e7cd627c1eb2ba
Author: Will Smith <lol.tihan@gmail.com>
Date:   Fri Sep 4 23:20:01 2015 -0700

    Inline test should use struct types
上级 9eb27a0a
......@@ -34,6 +34,7 @@ module Vector3MutableField =
let inline dot (v1: Vector3MutableField) (v2: Vector3MutableField) =
v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
[<Struct>]
[<StructLayout (LayoutKind.Sequential)>]
type Vector3NestedMutableField =
val x : single
......@@ -48,6 +49,7 @@ module Vector3NestedMutableField =
let inline test (v1: Vector3NestedMutableField) (v2: Vector3NestedMutableField) =
v1.x * v2.x + v1.y.y * v2.y.y + v1.z * v2.z
[<Struct>]
[<StructLayout (LayoutKind.Sequential)>]
type Vector3Generic<'T> =
val x : 'T
......@@ -58,6 +60,12 @@ type Vector3Generic<'T> =
[<RequireQualifiedAccess>]
[<CompilationRepresentation (CompilationRepresentationFlags.ModuleSuffix)>]
module Vector3Generic =
module Vector3GenericInt =
let inline test (v1: Vector3Generic<int>) (v2: Vector3Generic<int>) =
v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
\ No newline at end of file
v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
[<RequireQualifiedAccess>]
[<CompilationRepresentation (CompilationRepresentationFlags.ModuleSuffix)>]
module Vector3GenericObj =
let inline test (v1: Vector3Generic<obj>) (v2: Vector3Generic<obj>) =
v1.x
......@@ -11,5 +11,8 @@ let testVector3MutableFieldDotInline (v1: Vector3MutableField) =
let testVector3NestedMutableFieldTestInline (v1: Vector3NestedMutableField) =
Vector3NestedMutableField.test v1 v1
let testVector3GenericInline (v1: Vector3Generic<'T>) =
Vector3Generic.test v1 v1
\ No newline at end of file
let testVector3GenericInline (v1: Vector3Generic<int>) =
Vector3GenericInt.test v1 v1
let testVector3GenericInline2 (v1: Vector3Generic<obj>) =
Vector3GenericObj.test v1 v1
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册