{"id":5841,"date":"2014-04-07T09:36:48","date_gmt":"2014-04-07T09:36:48","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/07\/problem-about-abstract-type-collection-of-common-programming-errors\/"},"modified":"2014-04-07T09:36:48","modified_gmt":"2014-04-07T09:36:48","slug":"problem-about-abstract-type-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/07\/problem-about-abstract-type-collection-of-common-programming-errors\/","title":{"rendered":"problem about abstract-type-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e208066867d3d9c32a0a8ec27dbb90c7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAdrian<br \/>\nscala abstract-class abstract-type<br \/>\nI want to define a constructor in an abstract class that will create concrete subclasses.abstract class A {type Impl &lt;: Adef construct() : Impl = {val res = new Impl() \/\/compile error: class type required but A.this.Impl found\/\/ do more initialization with res} }class B extends A {type Impl = B} class C extends A {type Impl = C} \/\/&#8230; val b = new B b.construct() \/\/ this should create a new instance of BWhat is wrong here? Is this even possible to implement? EDIT: Clarification: I want to abst<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adrian scala abstract-class abstract-type I want to define a constructor in an abstract class that will create concrete subclasses.abstract class A {type Impl &lt;: Adef construct() : Impl = {val res = new Impl() \/\/compile error: class type required but A.this.Impl found\/\/ do more initialization with res} }class B extends A {type Impl = B} [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5841","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5841"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5841\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}