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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:41:22+00:00 2026-05-22T16:41:22+00:00

What is the supertype for all Scalaquery queries? As far as i have understood,

  • 0

What is the supertype for all Scalaquery queries?

As far as i have understood, Query[Projection[Product]] should be it, e.g.:

   Projection2[Int, Int]
<: Projection[Tuple2[Int,Int]]
<: Projection[Product]

so val query: Query[Projection[Product]] = for (all <- Tab) yield all.* should work for Tab = new Table[(Int, Int)] {…}

…but appearantly i don’t understand how typing in scala works.

I’m totally confused, so if i missed something, please ask.

  • 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-22T16:41:23+00:00Added an answer on May 22, 2026 at 4:41 pm

    This doesn’t work because the type parameter for Projection is invariant and it would need to be covariant for Projection[Product] to be a supertype of Projection[(Int,Int)]. Thus Query[Projection[Product]] is not a supertype of Query[Projection[(Int,Int)]], which is the reason why the compiler is complaining.

    Everything clear? If not, read about invariance and covariance in wikipedia and in the Scala reference.

    The type of all Querys of Projections of X, where X is a subtype of Product, is Query[Projection[X]] forSome { type X <: Product }.

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

Sidebar

Related Questions

Let's say I have several POJOs which all extend a common supertype, BaseObject .
I have an Abstract type called Product, and five Types that inherit from Product
I have 3 tables, one which represents a supertype, with an ID column. Two
I'm using EF 4.3 with CodeFirst and I have a supertype/subtype model similar to
I have a database of resources with the typical address, email and all that
Basically, I have a supertype( Person) and subtype (Student). I have to insert into
I have the following database relational schema that purports to model an EMP supertype
I have some classes with the same super-type. Therefore all of this classes have
I have a abstract class which has some common methods for all of my
I am designing a REST API where some resources can be filtered through query

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.