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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:19:14+00:00 2026-05-15T08:19:14+00:00

folks. So, I’ve came across this compilation error a while ago.. As there’s an

  • 0

folks. So, I’ve came across this compilation error a while ago.. As there’s an easy fix and I didn’t find anything relevant at the time, I eventually let it go.

I just remembered it and I’m now wondering if this is really part of the language grammar (which I highly doubt) or if it’s a compiler bug. I’m being purely curious about this — it doesn’t really affect development, but it would be nice to see if any of you have seen this already.

package view {
    import flash.display.Sprite;

    public class Main extends Sprite {
        private var _view:Sprite = new Sprite();

        public function Main() {
            this.test();
        }

        private function test():void {
            trace(this.view.x, this.view.y);
            //1178: Attempted access of inaccessible property x through a reference with static type view:Main.
            //1178: Attempted access of inaccessible property y through a reference with static type view:Main.
            //Note that I got this due to the package name.
            //It runs just fine if I rename the package or getter.
        }

        public function get view():Sprite {
            return this._view;
        }
    }
}
  • 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-15T08:19:15+00:00Added an answer on May 15, 2026 at 8:19 am

    I’d say this is either a compiler bug or an inconsistency in the spec.

    Quote from the chapter 11.1 Package namespace (I’d link directly, but the docs use frames):

    Packages exist only at compile time.
    The static existence of packages
    allows us to give them certain
    properties that would not be possible
    if they could be manipulated at
    runtime. In particular:

    Package names may have embedded dots.
    Fully qualified package references may
    and must be expressed using the dot
    operator rather than the usual ::
    syntax for qualified names.

    But because there is no runtime value
    for a package name, packages cannot be
    aliased or otherwise used in an
    expression that uses a runtime value.

    When encountered in a valid context by
    the compiler, the meaning of a package
    name becomes fixed; any interpretation
    at runtime is no longer possible.

    For this reason, a package name always
    shadows locally defined names,
    independent of the scope chain, when
    that package name is used on the left
    hand side of a dot operator.

    Now, from the above, I gather that this line:

    trace(this.view.x, this.view.y);
    

    Shouldn’t be interpreted by the compiler as refering to the view package, since it seems to contradict this point — I’ll call it A):

    packages cannot be aliased or otherwise
    used in an expression that uses a runtime
    value

    Because this, unless I’m mistaken, is a runtime value.

    Then, if you use this the ambiguity could be solved as your getter, I think, but according to this paragraph — let’s call it B), it won’t:

    For this reason, a package name always
    shadows locally defined names,
    independent of the scope chain,
    when that package name is used on the
    left hand side of a dot operator.

    So, if you don’t use this, it’s clear from the spec that view.x should be interpreted as a reference to the defintion of x in the view package.

    If you explicitly say this, there’s a contradiction between A) and B), as I see it. According to A) there should be no aliasing; but the aliasing is happening, it seems, because there’s a package name used on the left of a dot operator. So my guess is the compiler is not parsing the package in context, so to speak, just checking if any name on the left of a dot operator matches the name of a defined package.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Folks, This is easy, but I cannot seem to get this right, any help
Folks, It could be fairly easy but I could not find easy solution so
folks! I have project in cc.net and this project nay start by 3 ways
Folks I have a sealed class as follows. I want to extend this sealed
Folks, is there a collection of gotchas where Numpy differs from python, points that
Folks, I am creating an installer project in Visual Studio. This is done using
Folks, I have a HTML file which contains a button called Email this content
Folks, Apologies if this has been covered in another thread, but I have searched
Folks, I know there have been lots of threads about forcing the download dialog
folks. I'm starting with CakePHP and after reviewing this tutorial ( http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application ) and

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.