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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:10:05+00:00 2026-05-25T06:10:05+00:00

I have the following scenario: sealed abstract class Type(val inUse: Boolean) case class IntTy(override

  • 0

I have the following scenario:

sealed abstract class Type(val inUse: Boolean)

case class IntTy(override val inUse: Boolean) extends Type(inUse)

case class TupleTy(override val inUse: Boolean, elems: Type*) extends Type(inUse) {
  def this(elems: Type*) = this(false, elems:_*)
}

In Scala 2.8.0 this works just fine and I can create a new TupleTy instance with:

TupleTy(IntTy(false))

However, I’ve just updated to Scala 2.9.1 final and it no longer works. I now get the following error:

error: type mismatch;
found   : IntTy
required: Boolean
              TupleTy(IntTy(false))
                           ^

Is this a bug or am I missing somehing?

  • 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-25T06:10:06+00:00Added an answer on May 25, 2026 at 6:10 am

    I’m not sure that it works in 2.8.0.

    You have defined an additional constructor, but not an additional factory method.

    new TupleTy(IntTy(false)) // works as expected
    

    EDIT

    Here is a possible workaround

    case class TupleTy(override val inUse: Boolean = false)(elems: Type*) extends Type(inUse)
    

    Now you can do ugly things like this, but you shouldn’t. No really, you shouldn’t.

    TupleTy()(IntTy(false))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following scenario in nHibernate: <class name=TestApp.Components.User,TestApp.Components table=Users> <id name=Id column=UserId type=Int32
I have the following scenario, class foo { ... private: char *_test; }; void
I have this following scenario namespace A { //... class A { public: static
I have the following scenario: class my_base { ... } class my_derived : public
I have the following scenario and I'm not sure if I should use Class
I have the following scenario: @Entity class A { @Id @GeneratedValue private long dbId;
I have the following scenario: class Foo { } class Foo<T> : Foo {
I have the following scenario I have a main form as MDI parent and
I have a following scenario – and what I am really looking is real
I have the following scenario: Entities are loaded from the database. One of them

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.