Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7051177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:13:57+00:00 2026-05-28T03:13:57+00:00

This works open System let f = Action(fun () -> Unchecked.defaultof<_>) But this let

  • 0

This works

open System
let f = Action(fun () -> Unchecked.defaultof<_>)

But this

let f = System.Action(fun () -> Unchecked.defaultof<_>)

produces the compilation error

Multiple types exist called ‘Action’, taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. ‘Action<,,_,,,_,,,_>’.

I know I can fix it by adding a type parameter placeholder (System.Action<_>(...)), but any idea why they behave differently?

EDIT

Found this in the spec, section 14.1.9:

When a module or namespace declaration group F is opened, items are added to the name environment as follows:

  • Add the type to the TypeNames table. If the type has a CLI-mangled generic name such as List'1 then an entry is added under both List and List'1.

Is this behavior replicated for fully-qualified types (with omitted type parameters)? It doesn’t appear so.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:13:57+00:00Added an answer on May 28, 2026 at 3:13 am

    I agree with @James that this is related to the bug submitted on Connect, but I think it is a slightly different case. Anyway, I think this is not the intended behaviour. Could you report it to fsbugs at microsoft dot com?

    Anyway – I did some debugging and here is what I found so far:

    It seems that the compiler uses different code paths to resolve the name Action and the name System.Action. When resolving the other, it searches all loaded modules (i.e. assemblies) for a type named System.Action (see ResolveLongIndentAsModuleOrNamespaceThen function in the nameres.fs file of the open-source release).

    This finds the two definitions of Action (one in mscorlib and another in System.Core). I think the issue comes from the fact that the name resolution simply iterates over the results – it finds the first one (from System.Core), which doesn’t have a usable overload (because it ranges from Action<_,_,_,_,_> to a version with about 15 type parameters). After finding this type, it reports an error without even looking whether there is another type (in another assembly) that could be used.

    If you don’t reference system assemblies, then the F# compiler resolves the overload just fine. Running the compiler without parameters references the default assembly set, so this doesn’t work:

    fsc test.fs 
    

    but if I add the --noframework flag, then it compiles without issues:

    fsc --noframework test.fs
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Eclipse, I can switch through open editors using control-page up/down. This works great,
httpd = make_server('', 80, server) webbrowser.open(url) httpd.serve_forever() This works cross platform except when I
This .NET API works OK if I'm trying to open the Registry in a
This works, but is it the proper way to do it??? I have a
This works fine: $.getJSON(http://localhost:59396/xxxWeb/ CarouselHandler.ashx?action=getproducts&ids= + ids, function(data) { carousel.size(allProductIDs.length); if (numberOfImagesLeftToShow < numberOfImagesToDisplay)
This works: Tweener.addTween( [ _fee, _fye, _fum ] , { alpna:1, time:10 }); But
Try to run this in F# interactive: #r System.ServiceModel #r System.Runtime.Serialization open System.ServiceModel [<ServiceContract>]
So i have this: open System open System.Linq open Microsoft.FSharp.Collections type Microsoft.FSharp.Collections.List<'a> with static
Will a query like this on a recordset work rs.open select * from table
This works (prints, for example, 3 arguments): to run argv do shell script echo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.