Skip to content

Commit

Permalink
Compiler Warning when touching the Type Provider Internals
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Minerich <[email protected]>
  • Loading branch information
Rickasaurus committed Oct 19, 2013
1 parent dbee202 commit ffbde66
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ open FSMatlab.InterfaceTypes

open TestHelpers

#nowarn "10001" // Speical warning for Type Provider internals

[<Fact>]
let ``supported instance types should round trip`` () =
let vs : (obj) list =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Release\MatlabTypeProvider.Tests.XML</DocumentationFile>
<PlatformTarget>x64</PlatformTarget>
<NoWarn />
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
Expand All @@ -46,7 +47,7 @@
</ItemGroup>
<ItemGroup>
<Reference Include="MatlabTypeProvider">
<HintPath>..\..\MatlabTypeProvider\MatlabTypeProvider\bin\Debug\MatlabTypeProvider.dll</HintPath>
<HintPath>..\..\MatlabTypeProvider\MatlabTypeProvider\bin\Release\MatlabTypeProvider.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

open Xunit

#nowarn "10001" // Speical warning for Type Provider internals

let AssertNoVariableChanges (testfun: unit -> unit) =
let startVars = FSMatlab.MatlabInterface.executor.GetVariableInfos()
testfun()
Expand Down
11 changes: 9 additions & 2 deletions MatlabTypeProvider/MatlabTypeProvider/MatlabTypeProvider.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Debug\MatlabCOMTypeProvider.XML</DocumentationFile>
<DocumentationFile>bin\Debug\MatlabTypeProvider.XML</DocumentationFile>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe</StartProgram>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartArguments>"C:\Users\rminerich\Documents\GitHub\Matlab-Type-Provider\MatlabTypeProvider.Debug\MatlabTypeProvider.Debug\MatlabTypeProvider.Debug\MatlabTypeProvider.Debug.fsproj"</StartArguments>
<NoWarn>10001</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,7 +35,8 @@
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Release\MatlabCOMTypeProvider.XML</DocumentationFile>
<DocumentationFile>bin\Release\MatlabTypeProvider.XML</DocumentationFile>
<NoWarn>10001</NoWarn>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
Expand Down
5 changes: 3 additions & 2 deletions MatlabTypeProvider/MatlabTypeProvider/Provider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ open Samples.FSharp.ProvidedTypes
open FSMatlab.InterfaceTypes
open FSMatlab.Interface

[<CompilerMessageAttribute("For Type Provider internal use only.", 10001)>] // Special number blessed by Tomas
module MatlabInterface =
let private comProxy = new FSMatlab.MatlabCOM.MatlabCOMProxy("Matlab.Desktop.Application")
let executor = MatlabCommandExecutor(comProxy)
Expand Down Expand Up @@ -64,12 +65,12 @@ module LazyProviderHelpers =
else Quotations.Expr.NewArray(typeof<obj>, [])

let namedInArgs = if hasVarargin then
let nArgs = arrArgs.[0 .. arrArgs.Length - 2] //|> Array.map (fun expr -> Quotations.Expr.Coerce(expr, typeof<obj>))
let nArgs = arrArgs.[0 .. arrArgs.Length - 2]
Quotations.Expr.NewArray(typeof<obj>, nArgs |> Array.toList)
else Quotations.Expr.NewArray(typeof<obj>, args)

<@@
let finfo = MatlabInterface.executor.GetFunctionInfoFromName name
let finfo = MatlabInterface.executor.GetFunctionInfoFromName name
let fhandle = MatlabInterface.executor.GetFunctionHandle(finfo)
let vettedInArgs =
let namedInArgs = (%%namedInArgs : obj[])
Expand Down

0 comments on commit ffbde66

Please sign in to comment.