Return-Path: X-Original-To: apmail-groovy-notifications-archive@minotaur.apache.org Delivered-To: apmail-groovy-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9F9518973 for ; Sat, 9 Apr 2016 19:55:25 +0000 (UTC) Received: (qmail 9841 invoked by uid 500); 9 Apr 2016 19:55:25 -0000 Delivered-To: apmail-groovy-notifications-archive@groovy.apache.org Received: (qmail 9806 invoked by uid 500); 9 Apr 2016 19:55:25 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 9759 invoked by uid 99); 9 Apr 2016 19:55:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2016 19:55:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 743292C1F5C for ; Sat, 9 Apr 2016 19:55:25 +0000 (UTC) Date: Sat, 9 Apr 2016 19:55:25 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-7813) Calling a non-static outer class method from a static class passes STC 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/GROOVY-7813?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D152= 33703#comment-15233703 ]=20 ASF GitHub Bot commented on GROOVY-7813: ---------------------------------------- GitHub user shils opened a pull request: https://github.com/apache/groovy/pull/309 GROOVY-7813: Calling a non-static outer class method from a static cl= =E2=80=A6 =E2=80=A6ass should fail STC You can merge this pull request into a Git repository by running: $ git pull https://github.com/shils/groovy GROOVY-7813 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/309.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #309 =20 ---- commit ef18f20a62a99ade18a4fac9028fca7edf61419a Author: Shil Sinha Date: 2016-04-09T19:54:08Z GROOVY-7813: Calling a non-static outer class method from a static clas= s should fail STC ---- > Calling a non-static outer class method from a static class passes STC > ---------------------------------------------------------------------- > > Key: GROOVY-7813 > URL: https://issues.apache.org/jira/browse/GROOVY-7813 > Project: Groovy > Issue Type: Bug > Components: Static Type Checker > Affects Versions: 2.4.6 > Reporter: Shil Sinha > Assignee: Shil Sinha > > Example: > {code} > @groovy.transform.TypeChecked > class Foo { > def bar() { 2 } > static class Baz { > def doBar() { > bar() > } > } > } > new Foo.Baz().doBar() > {code} > The {{doBar()}} call in the method above results in a MissingMethodExcept= ion. If the code is statically compiled rather than just type checked, a Ve= rifyError occurs instead. =20 > The usage of {{ClassNode#isStaticClass()}} within {{StaticTypeCheckingVis= itor#findMethod(ClassNode, String, ClassNode...)}} seems to be responsible,= as the former does not return true when the receiver is a static class. -- This message was sent by Atlassian JIRA (v6.3.4#6332)