From issues-return-9898-apmail-flex-issues-archive=flex.apache.org@flex.apache.org Wed Dec 23 15:54:47 2015 Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2E56B186B4 for ; Wed, 23 Dec 2015 15:54:47 +0000 (UTC) Received: (qmail 42478 invoked by uid 500); 23 Dec 2015 15:54:47 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 42428 invoked by uid 500); 23 Dec 2015 15:54:47 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 42238 invoked by uid 99); 23 Dec 2015 15:54:46 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Dec 2015 15:54:46 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BE9952C1F5D for ; Wed, 23 Dec 2015 15:54:46 +0000 (UTC) Date: Wed, 23 Dec 2015 15:54:46 +0000 (UTC) From: "Alex Harui (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (FLEX-34993) implicit super() constructor call receives subclass constructor params MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-34993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Harui reassigned FLEX-34993: --------------------------------- Assignee: Alex Harui > implicit super() constructor call receives subclass constructor params > ---------------------------------------------------------------------- > > Key: FLEX-34993 > URL: https://issues.apache.org/jira/browse/FLEX-34993 > Project: Apache Flex > Issue Type: Bug > Components: Falcon, FlexJS > Affects Versions: Apache FlexJS 0.5.0 > Reporter: Andy Dufilie > Assignee: Alex Harui > Priority: Minor > > AS input (2 files): > {code} > package foo.bar { > public class MySuperClass { > public function MySuperClass(superParam1:String = "Hello", superParam2:String = "World") > { > this.superString = superParam1 + superParam2; > } > public var superString:String; > } > } > package foo.bar { > public class MyExtendingClass extends MySuperClass { > public function MyExtendingClass(extendingParam:String) > { > this.myExtendingString = extendingParam; > } > public var myExtendingString:String; > } > } > {code} > JS output (relevant part only): > {code} > /** > * @constructor > * @extends {foo.bar.MySuperClass} > * @param {string} extendingParam > */ > foo.bar.MyExtendingClass = function(extendingParam) { > foo.bar.MyExtendingClass.base(this, 'constructor', extendingParam); > this.myExtendingString = extendingParam; > }; > goog.inherits(foo.bar.MyExtendingClass, foo.bar.MySuperClass); > {code} > The correct behavior would be to implicitly call the default constructor (no params): > {code} > foo.bar.MyExtendingClass.base(this, 'constructor'); > {code} > The current workaround is to explicitly call super() with no params in the subclass. -- This message was sent by Atlassian JIRA (v6.3.4#6332)