Skip to content

Commit 1be5ddd

Browse files
committed
Assembler: fix bug with processMethodSignature.
1 parent e8e9497 commit 1be5ddd

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Naggum.Assembler/Assembler.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let processMethodSignature = function
3737
ContainingType = Some (resolveType typeName) // TODO: Resolve methods without a type (e.g. assembly methods)
3838
Name = methodName
3939
ArgumentTypes = resolveTypes argumentTypes
40-
ReturnType = resolveType typeName }
40+
ReturnType = resolveType returnType }
4141
| other -> failwithf "Unrecognized method signature: %A" other
4242

4343
let processInstruction = function

Naggum.Assembler/Representation.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ type AssemblyUnit =
3636
type Assembly =
3737
{ Name : string
3838
Units : AssemblyUnit list }
39+
override this.ToString () = sprintf "%A" this

Naggum.Test/AssemblerTests.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ let checkPreparationResult (source : string) (expected : Assembly list) =
3131
use stream = new MemoryStream(Encoding.UTF8.GetBytes source)
3232
let actual = Assembler.prepare "file.ngi" stream |> Seq.toList
3333

34+
Assert.Equal (expected.ToString (), actual.ToString ()) // for diagnostic
3435
Assert.Equal<Assembly list> (expected, actual)
3536

3637
[<Fact>]

0 commit comments

Comments
 (0)