Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8A898200C78 for ; Thu, 18 May 2017 09:36:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 891FE160BD0; Thu, 18 May 2017 07:36:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CC8A1160BC4 for ; Thu, 18 May 2017 09:36:08 +0200 (CEST) Received: (qmail 92782 invoked by uid 500); 18 May 2017 07:36:08 -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 92773 invoked by uid 99); 18 May 2017 07:36:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 May 2017 07:36:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 8E0BDC061B for ; Thu, 18 May 2017 07:36:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id eXaWK4IRHP3C for ; Thu, 18 May 2017 07:36:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5357C5FB96 for ; Thu, 18 May 2017 07:36:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D623FE0BDF for ; Thu, 18 May 2017 07:36:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 36163263A8 for ; Thu, 18 May 2017 07:36:04 +0000 (UTC) Date: Thu, 18 May 2017 07:36:04 +0000 (UTC) From: "Paul King (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (GROOVY-8188) Unpredictable behavior - Compiler error: groovyc: You are not allowed to override the final method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 18 May 2017 07:36:09 -0000 [ https://issues.apache.org/jira/browse/GROOVY-8188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16015339#comment-16015339 ] Paul King edited comment on GROOVY-8188 at 5/18/17 7:35 AM: ------------------------------------------------------------ Ah, okay, I didn't see it before. It's a bridge method added for a covariant return type. The ClassCompletionVerifier doesn't seem to look at return type which seems wrong to me. Here is a smaller example which exhibits the problem: {code} interface Foo { Foo foo() } abstract class FooImpl implements Foo { final FooImpl foo() { null } } class Main extends FooImpl implements Foo { } assert !new Main().foo() {code} Note that the {{implements Foo}} in {{Main}} is redundant but required to produce the error. was (Author: paulk): Ah, okay, I didn't see it before. It's a bridge method added for a covariant return type. The ClassCompletionVerifier doesn't seem to look at return type which seems wrong to me. Here is a smaller example which exhibits the problem: {code} interface Foo { Foo foo() } abstract class FooImpl implements Foo { final FooImpl foo() { null } } class Main extends FooImpl implements Foo { } assert !new Main().foo() {code} Note that the {{implements Foo}} is redundant but required to produce the error. > Unpredictable behavior - Compiler error: groovyc: You are not allowed to override the final method > -------------------------------------------------------------------------------------------------- > > Key: GROOVY-8188 > URL: https://issues.apache.org/jira/browse/GROOVY-8188 > Project: Groovy > Issue Type: Bug > Components: Compiler > Affects Versions: 2.4.11 > Environment: Windows > Reporter: Abbas Gadhia > Attachments: groovyc.7z > > > I'm trying to extend from an abstract class and override one of its abstract methods. Another "final" concrete method of the same name exists in the abstract class. > When I compile, it complains that i cannot override the method marked as final, however i've only overriden the abstract method, and not the "final" one. > This issue is sporadic. The error pops up and goes after several retries > I've attached a simple project that reproduces this issue. The error may or may not happen the first time. Tweaking the code here and there, gets the issue to pop up > Here's a sample of the error message > bq. Error:Groovyc: You are not allowed to override the final method copy(org.apache.calcite.plan.RelTraitSet -> org.apache.calcite.plan.RelTraitSet,java.util.List -> java.util.List ) from class 'org.apache.calcite.rel.core.Join'. -- This message was sent by Atlassian JIRA (v6.3.15#6346)