Return-Path: X-Original-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A7BED879 for ; Tue, 28 Aug 2012 17:52:10 +0000 (UTC) Received: (qmail 22306 invoked by uid 500); 28 Aug 2012 17:52:09 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 22270 invoked by uid 500); 28 Aug 2012 17:52:08 -0000 Mailing-List: contact flex-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-dev@incubator.apache.org Received: (qmail 22261 invoked by uid 99); 28 Aug 2012 17:52:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Aug 2012 17:52:08 +0000 Date: Wed, 29 Aug 2012 04:52:08 +1100 (NCT) From: "Alex Harui (JIRA)" To: flex-dev@incubator.apache.org Message-ID: <2120526205.7329.1346176328905.JavaMail.jiratomcat@arcas> In-Reply-To: <719165893.5777.1346155987613.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-33182?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1344= 3310#comment-13443310 ]=20 Alex Harui commented on FLEX-33182: ----------------------------------- I checked with Jeff Dyer, who is the creator of ActionScript 3. He said: ---------BEGIN QUOTE --------------- Overriding vars is not allowed in AS3. When I compile the code in the bug r= eport with an asc.jar from last year, here are the errors I get: jeff-dyers-imac:asc-main jeffdyer$ java -jar asc.jar t.as =20 [Compiler] Error #1017: The definition of base class Object was not found. =C2=A0 =C2=A0t.as , Ln 1, Col 1:=C2=A0 =C2=A0 =C2=A0package publicoverridevsoverridepublic=C2=A0 =C2=A0 =C2=A0^ 1 error found jeff-dyers-imac:asc-main jeffdyer$ java -jar asc.jar -import builtin.abc t.= as =20 [Compiler] Error #1023: Incompatible override. =C2=A0 =C2=A0t.as , Ln 20, Col 44:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0override publ= ic function set var1(value:String):void=C2=A0 =C2=A0 =C2=A0...........................................^ [Compiler] Error #1023: Incompatible override. =C2=A0 =C2=A0t.as , Ln 25, Col 44:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0override publ= ic function get var1():String=C2=A0 =C2=A0 =C2=A0...........................................^ [Compiler] Error #1023: Incompatible override. =C2=A0 =C2=A0t.as , Ln 38, Col 44:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0public overri= de function set var1(value:String):void=C2=A0 =C2=A0 =C2=A0...........................................^ [Compiler] Error #1023: Incompatible override. =C2=A0 =C2=A0t.as , Ln 43, Col 44:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0public overri= de function get var1():String=C2=A0 =C2=A0 =C2=A0...........................................^ 4 errors found ------------- END QUOTE ------------- So, this is a compiler issue. The compiler should not be allowing this to = compile in the first place. I assume you are using MXMLC? =20 > override public in subclass results in public write only property. public= override works as expected > -------------------------------------------------------------------------= --------------------------- > > Key: FLEX-33182 > URL: https://issues.apache.org/jira/browse/FLEX-33182 > Project: Apache Flex > Issue Type: Bug > Affects Versions: Adobe Flex SDK 4.6 (Release) > Environment: Flash Builder 4.6 > Reporter: Michael Grove > Attachments: test.zip > > > I'll upload a zip of classes and test cases for flexunit that demonstrate= this problem. Here's the gist: > We=E2=80=99ve found that the list of accessors is different if a derived = class overrides a getter/setter with =E2=80=9Cpublic override=E2=80=9D vs. = =E2=80=9Coverride public=E2=80=9D. =E2=80=9Coverride public=E2=80=9D intro= duces an additional write only public property as shown in both describeTyp= e output and in Flash Builder. > Here are some simple classes that demonstrate the problem, text continued= below. > package publicoverridevsoverridepublic > { > [Bindable] > public class BaseClass > { > public var var1:String; > public var var2:String; > } > } > package publicoverridevsoverridepublic > { > [Bindable] > public class SubClassOverridePublic extends BaseClass > { > override public function set var1(value:String):void > { > super.var1 =3D value; > } > override public function get var1():String > { > return super.var1; > } > } > } > package publicoverridevsoverridepublic > { > [Bindable] > public class SubClassPublicOverride extends BaseClass > { > public override function set var1(value:String):void > { > super.var1 =3D value; > } > public override function get var1():String > { > return super.var1; > } > } > } > The attributes of SubClassPublicOverride in Flash Builder include a _361= 2138var1 property. It=E2=80=99s a private property that according to Flash= Builder is write only (only includes a setter). I=E2=80=99m not sure what= the purpose of this property is, or more generally any of the private prop= erties I=E2=80=99ve seen in Flash Builder with numeric prefixes like this. = And I=E2=80=99m not sure why it is believed only to have a setter. But as= it is private, it is not included in the results from describeType(). > The attributes of SubClassOverridePublic in Flash Builder have the same _= 3612138var1 property but this time it is public and write only. > I've never heard of any language treating "public override" and "override= public" as semantically different and assume this must be a bug. > Note that some Flex formatters out there are preconfigured to favor =E2= =80=9Coverride public=E2=80=9D to =E2=80=9Cpublic override=E2=80=9D (that= =E2=80=99s actually what broke us =E2=80=93 formatting the file). If you= =E2=80=99re not using describeType you probably don=E2=80=99t care. But it= =E2=80=99d be interesting to know what else might be different between =E2= =80=9Coverride public=E2=80=9D and =E2=80=9Cpublic override=E2=80=9D. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira