Relax arg checking strictness (#123)

This commit is contained in:
Patrick Stevens
2024-04-16 22:47:06 +01:00
committed by GitHub
parent f7458f521e
commit 232d2ba5ec
3 changed files with 14 additions and 3 deletions

View File

@@ -188,7 +188,7 @@ type internal TypeWithInterfaceMock =
{ {
/// Implementation of IDisposable.Dispose /// Implementation of IDisposable.Dispose
Dispose : unit -> unit Dispose : unit -> unit
Mem1 : int -> string Mem1 : string option -> string[] Async
} }
/// An implementation where every method throws. /// An implementation where every method throws.

View File

@@ -46,4 +46,4 @@ type Curried<'a> =
[<GenerateMock>] [<GenerateMock>]
type TypeWithInterface = type TypeWithInterface =
inherit IDisposable inherit IDisposable
abstract Mem1 : int -> string abstract Mem1 : string option -> string[] Async

View File

@@ -343,7 +343,18 @@ module internal AstHelper =
} }
|> List.singleton |> List.singleton
} }
| _ -> failwith $"Unrecognised args in interface method declaration: %+A{args}" | arg ->
{
HasParen = false
Args =
{
Attributes = []
IsOptional = false
Id = None
Type = arg
}
|> List.singleton
}
|> fun ty -> |> fun ty ->
{ ty with { ty with
HasParen = ty.HasParen || hasParen HasParen = ty.HasParen || hasParen