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 4537650
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:42:14+00:00 2026-05-21T14:42:14+00:00

My first thought was: type ManyNavigationPropertyInfo<‘a,’b>(cfg:ManyNavigationPropertyConfiguration<‘a, ‘b>) = however it resolves ‘a and ‘b

  • 0

My first thought was:

type ManyNavigationPropertyInfo<'a,'b>(cfg:ManyNavigationPropertyConfiguration<'a, 'b>) =

however it resolves 'a and 'b as obj, but it should be classes – therefore I did:

type ManyNavigationPropertyInfo<‘a
when ‘a : not struct,’b when ‘b : not
struct>(cfg:ManyNavigationPropertyConfiguration<‘a,
‘b>) =

but that just throws an error saying

Unexpected symbol ‘,’ in type name.
Expected ‘>’ or other token.

What’s the correct way for declaring such a type?

UPDATE:

My full code is:

type ManyNavigationPropertyInfo<'a,'b>(cfg:ManyNavigationPropertyConfiguration<'a, 'b>) =
    member x.WithMany (expr: Expr<'a -> ICollection<'b>>) = 
        cfg.WithMany(ToLinq(expr))

and it comes up with 2 compiler errors saying that 'a and 'b should be not struct.

  • 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-21T14:42:14+00:00Added an answer on May 21, 2026 at 2:42 pm

    Your first thought is correct. You should be able to just write:

    type ManyNavigationPropertyInfo<'a,'b>
           (cfg:ManyNavigationPropertyConfiguration<'a, 'b>) =
       // ...
    

    The problem is probably somewhere later in the body of the type. From something that you wrote in the body, the compiler thinks that 'a and 'b must be of type obj (e.g. you’re passing values of this type somewhere where obj is expected, or probably something more subtle).

    You can try adding type annotations in the body of the class – this usually helps to find the issue, because the error message changes when you annotate the bit that F# compiler interprets differently than you expected.

    To solve the immediate problem in your question – the syntax for specifying constraint is a bit different (first write all type variables and then constraints):

    type ManyNavigationPropertyInfo<'a, 'b when 'a : not struct and 'b : not struct>( ... )
    

    (But if you can post larger portion of code, maybe somebody can give a concrete advice.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

@ first I thought it wasn't firing, but saw this So I waited and
I very rarely meet any other programmers! My thought when I first saw the
And I'm not meaning Bits Per Minute, but Business Process Management. At first though
First of all, I know how to build a Java application. But I have
just when I thought I understood something about type conversion in JavaScript, I stumbled
After seeing this question , my first thought was that it'd be trivial to
EDIT: the problem was not on hiding them (as I first thought), It was
Possible Duplicate: What exactly is nullptr? I first thought it's a keyword. My present
First, let's get the security considerations out of the way. I'm using simple authentication
First off, I am using Windows XP. I have multiple hard drives and it

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.