Permalink
Browse files

Fixed genclass bugs. Fixes #50. Fixes #51.

  • Loading branch information...
1 parent 2cc7480 commit bc41335ff187bb4c274b5317ca819bed6def6707 @dmiller dmiller committed Aug 9, 2011
Showing with 51 additions and 5 deletions.
  1. +1 −1 Clojure/Clojure.Source/clojure/genclass.clj
  2. +13 −3 Clojure/Clojure/CljCompiler/GenClass.cs
  3. +37 −1 FxCop/Clojure.FxCop
@@ -247,7 +247,7 @@
[& options]
(let [x *compile-files*]
(when *compile-files*
- (let [options-map (apply hash-map options)]
+ (let [options-map (into1 {} (map vec (partition 2 options)))]
`'~(generate-class options-map)))))
@@ -478,11 +478,21 @@ static void EmitMain(GenContext context, TypeBuilder proxyTB, string mainName, F
MethodSignature sig,
ElseGenDelegate elseGen)
{
- MethodAttributes attribs = MethodAttributes.Public;
+ MethodAttributes attributes;
+ CallingConventions conventions;
+
if (isStatic)
- attribs |= MethodAttributes.Static;
+ {
+ attributes = MethodAttributes.Public | MethodAttributes.Static;
+ conventions = CallingConventions.Standard;
+ }
+ else
+ {
+ attributes = MethodAttributes.Public | MethodAttributes.Virtual;
+ conventions = CallingConventions.HasThis;
+ }
- MethodBuilder mb = proxyTB.DefineMethod(sig.Name, MethodAttributes.Public| MethodAttributes.Virtual, CallingConventions.HasThis, sig.ReturnType, sig.ParamTypes);
+ MethodBuilder mb = proxyTB.DefineMethod(sig.Name, attributes, conventions, sig.ReturnType, sig.ParamTypes);
ILGen gen = new ILGen(mb.GetILGenerator());
Label foundLabel = gen.DefineLabel();
View
@@ -21,7 +21,9 @@
<IgnoreGeneratedCode>False</IgnoreGeneratedCode>
</ProjectOptions>
<Targets>
+ <Target Name="$(ProjectDir)/../bin/4.0/Debug/Clojure.Compile.exe" Analyze="True" AnalyzeAllChildren="True" />
<Target Name="$(ProjectDir)/../bin/4.0/Debug/Clojure.dll" Analyze="True" AnalyzeAllChildren="True" />
+ <Target Name="$(ProjectDir)/../bin/4.0/Debug/Clojure.Main.exe" Analyze="True" AnalyzeAllChildren="True" />
</Targets>
<Rules>
<RuleFiles>
@@ -197,5 +199,39 @@
<Groups />
<Settings />
</Rules>
- <FxCopReport Version="10.0" />
+ <FxCopReport Version="10.0">
+ <Targets>
+ <Target Name="$(ProjectDir)/../bin/4.0/Debug/Clojure.Compile.exe">
+ <Modules>
+ <Module Name="clojure.compile.exe">
+ <Messages>
+ <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2011-08-09 17:56:38Z">
+ <Issue Name="NoStrongName">
+ <Item>'Clojure.Compile.exe'</Item>
+ </Issue>
+ </Message>
+ </Messages>
+ </Module>
+ </Modules>
+ </Target>
+ <Target Name="$(ProjectDir)/../bin/4.0/Debug/Clojure.Main.exe">
+ <Modules>
+ <Module Name="clojure.main.exe">
+ <Messages>
+ <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2011-08-09 17:56:38Z">
+ <Issue Name="NoStrongName">
+ <Item>'Clojure.Main.exe'</Item>
+ </Issue>
+ </Message>
+ </Messages>
+ </Module>
+ </Modules>
+ </Target>
+ </Targets>
+ <Rules>
+ <Rule TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210">
+ <Resolution Name="NoStrongName">Sign {0} with a strong name key.</Resolution>
+ </Rule>
+ </Rules>
+ </FxCopReport>
</FxCopProject>

0 comments on commit bc41335

Please sign in to comment.