Skip to content

Error example #28513

@pbachmann

Description

@pbachmann

Following the instructions laid out in the Dugnad session on YouTube, here is my first attempt at highlighting an example of this error:

let Sum x y = x + y
let RegisterFunction1 (fn:'A->'B) = ()
let Test1 = RegisterFunction1 Sum
let RegisterFunction2 (fn:'A->int) = ()
let Test2 = RegisterFunction2 Sum

RegisterFunction1 works and RegisterFunction2 has a FS0001 error. As best as I can make it, RegisterFunction1 maps 'A to int and 'B to int->int which is why it compiles. RegisterFunction2 also maps 'A to int but then errors when it sees that what's left (int->int) does not match the int return value.

It should be said that the explanation provided on this page, "This message can be issued in many different circumstances, etc." along with the remedies prescribed steer one in the right direction, however I am still unsure whether it is possible to create a RegisterFunction which mandates the return type!


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 498241

Metadata

Metadata

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.dotnet-fsharp/svcin-prThis issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions