flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Harui (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (FLEX-34993) implicit super() constructor call receives subclass constructor params
Date Wed, 23 Dec 2015 15:54:46 GMT

     [ 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)

Mime
View raw message