File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -802,11 +802,8 @@ module TypeHelpers =
802802 open Patterns
803803
804804 let genParamName ( genParam : FSharpGenericParameter ) =
805- // Sometimes the names of user-declared and compiler-generated clash, see #1900
806- //if genParam.IsCompilerGenerated then genParam.Name.Replace("?", "$") + "$" else genParam.Name
807-
808- // Conflicting generic param names seem to have been solved in FCS
809- genParam.Name
805+ // Sometimes the names of user-declared and compiler-generated clash, see #1900 and https://github.com/dotnet/fsharp/issues/13062
806+ if genParam.IsCompilerGenerated then genParam.Name.Replace( " ?" , " $" ) + " $" else genParam.Name
810807
811808 let resolveGenParam ctxTypeArgs ( genParam : FSharpGenericParameter ) =
812809 let name = genParamName genParam
Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ let private transformUnionCaseTest (com: IFableCompiler) (ctx: Context) r
349349 let name = genParamName fi.FieldType.GenericParameter
350350 let index =
351351 tdef.GenericParameters
352- |> Seq.findIndex ( fun arg -> arg.Name = name)
352+ |> Seq.findIndex ( fun arg -> genParamName arg = name)
353353 genArgs.[ index]
354354 else fi.FieldType
355355 let kind = makeType ctx.GenericArgs typ |> Fable.TypeTest
@@ -1793,16 +1793,7 @@ let getInlineExprs fileName (declarations: FSharpImplementationFileDeclaration l
17931793 ctx, ident:: idents)
17941794
17951795 // It looks as we don't need memb.DeclaringEntity.GenericParameters here
1796- let genArgsSet = HashSet()
1797- let genArgs = memb.GenericParameters |> Seq.mapToList ( fun g ->
1798- let name = genParamName g
1799- if not ( genArgsSet.Add( name)) then // See https://github.com/fable-compiler/repl/issues/152
1800- let r = makeRange memb.DeclarationLocation |> Some
1801- $" Two generic arguments with same name: %s {name}, have been detected for method %s {memb.FullName}. "
1802- + " This may happen when type inference conflicts with generic arguments for the class. "
1803- + " Please type explicitly the arguments of the method."
1804- |> addWarning com [] r
1805- name)
1796+ let genArgs = memb.GenericParameters |> Seq.mapToList ( genParamName)
18061797
18071798 { Args = List.rev idents
18081799 Body = com.Transform( ctx, body)
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ type Service<'a> = {
129129 GetRecord: int -> int64 -> Async < 'a >
130130}
131131with
132- static member inline RouteBuilder ( _ : 'b ) m =
132+ static member inline RouteBuilder _ m =
133133 let name = typeof< 'a>. Name
134134 sprintf " /api/%s /%s " name m
135135
You can’t perform that action at this time.
0 commit comments