From dev-return-5261-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Fri Aug 24 23:20:52 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5DD7D180629 for ; Fri, 24 Aug 2018 23:20:51 +0200 (CEST) Received: (qmail 71140 invoked by uid 500); 24 Aug 2018 21:20:50 -0000 Mailing-List: contact dev-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 dev@groovy.apache.org Received: (qmail 71130 invoked by uid 99); 24 Aug 2018 21:20:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2018 21:20:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5657D1811C8 for ; Fri, 24 Aug 2018 21:20:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.499 X-Spam-Level: **** X-Spam-Status: No, score=4.499 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_WEB=1.5] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 9gjYOqwxvK0U for ; Fri, 24 Aug 2018 21:20:46 +0000 (UTC) Received: from smtp2.czechia.com (smtp2.czechia.com [217.198.120.48]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 4BB425F386 for ; Fri, 24 Aug 2018 21:20:46 +0000 (UTC) Received: from [10.0.0.141] (12.10.broadband11.iol.cz [90.178.10.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ocs@ocs.cz) by smtp2.czechia.com (Postfix) with ESMTPSA id B25CE80B4EAB for ; Fri, 24 Aug 2018 23:20:39 +0200 (CEST) From: "ocs@ocs" Content-Type: multipart/alternative; boundary="Apple-Mail=_4D20C86A-6750-49E6-97F4-24F1E84B4E04" Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: looks like a compiler bug? Message-Id: <6E5D7864-8CD1-461E-8B70-B21B07911FFC@ocs.cz> Date: Fri, 24 Aug 2018 23:20:39 +0200 To: dev@groovy.apache.org X-Mailer: Apple Mail (2.3445.8.2) --Apple-Mail=_4D20C86A-6750-49E6-97F4-24F1E84B4E04 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Ladies and gentlemen, I've just bumped into the problem shown below. Whilst it is arguable whether the situation should be valid or not = (myself, I strongly believe it should be valid and compiled without a = glitch), even if invalid, it should not cause an uncaught exception, but = simply report a syntax error, I believe? All the best, OC =3D=3D=3D 941 /tmp> >e.groovy class foo { void bar() { } void bax() { return bar() } } 942 /tmp> groovy e WARNING: Using incubator modules: jdk.incubator.httpclient org.codehaus.groovy.control.MultipleCompilationErrorsException: startup = failed: General error during class generation: Cannot use return statement with = an expression on a method that returns void . At [3:16] /private/tmp/e.groovy org.codehaus.groovy.syntax.RuntimeParserException: Cannot use return = statement with an expression on a method that returns void . At [3:16] /private/tmp/e.groovy at = org.codehaus.groovy.classgen.AsmClassGenerator.throwException(AsmClassGene= rator.java:718) at = org.codehaus.groovy.classgen.asm.StatementWriter.writeReturn(StatementWrit= er.java:602) at = org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeReturn(Opt= imizingStatementWriter.java:368) at = org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmCla= ssGenerator.java:686) at = org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:49= ) at = org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(State= mentWriter.java:93) at = org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeBlockState= ment(OptimizingStatementWriter.java:210) at = org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClas= sGenerator.java:636) at = org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71) at = org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(Cl= assCodeVisitorSupport.java:110) at = org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(C= lassCodeVisitorSupport.java:121) at = org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGene= rator.java:496) at = org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(As= mClassGenerator.java:432) at = org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisit= orSupport.java:132) at = org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerat= or.java:577) at = org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1140) at = org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisito= rSupport.java:54) at = org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerato= r.java:270) at = org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:8= 50) at = org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(Compi= lationUnit.java:1087) at = org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUn= it.java:631) at = org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(Compila= tionUnit.java:609) at = org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:5= 86) at = groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:354) at = groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:87) at = groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:323) at = groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:320) at = org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedComm= onCache.java:162) at = org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCo= mmonCache.java:153) at = groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:318) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:547) at groovy.lang.GroovyShell.run(GroovyShell.java:376) at groovy.lang.GroovyShell.run(GroovyShell.java:366) at groovy.ui.GroovyMain.processOnce(GroovyMain.java:589) at groovy.ui.GroovyMain.run(GroovyMain.java:332) at groovy.ui.GroovyMain.access$1400(GroovyMain.java:69) at = groovy.ui.GroovyMain$GroovyCommand.process(GroovyMain.java:291) at groovy.ui.GroovyMain.processArgs(GroovyMain.java:134) at groovy.ui.GroovyMain.main(GroovyMain.java:116) at = java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native = Method) at = java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMetho= dAccessorImpl.java:62) at = java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Delegat= ingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at = org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:114)= at = org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:136) 1 error 943 /tmp> groovy -version WARNING: Using incubator modules: jdk.incubator.httpclient Groovy Version: 3.0.0-alpha-3 JVM: 10.0.1 Vendor: "Oracle Corporation" = OS: Mac OS X 944 /tmp>=20 =3D=3D=3D= --Apple-Mail=_4D20C86A-6750-49E6-97F4-24F1E84B4E04 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Ladies and gentlemen,

I've just bumped into the problem shown = below.

Whilst = it is arguable whether the situation should be valid or not (myself, I = strongly believe it should be valid and compiled without a glitch), even = if invalid, it should not cause an uncaught exception, but simply report = a syntax error, I believe?

All the best,
OC

=3D=3D=3D
941 /tmp> >e.groovy
class foo {
  void bar() { }
  void bax() { return bar() = }
}
942 /tmp> groovy e
WARNING: = Using incubator modules: jdk.incubator.httpclient
org.codehaus.groovy.control.MultipleCompilationErrorsException:= startup failed:
General = error during class generation: Cannot use return statement with an = expression on a method that returns void
. At [3:16] /private/tmp/e.groovy

org.codehaus.groovy.syntax.RuntimeParserException: Cannot use = return statement with an expression on a method that returns = void
. At = [3:16] /private/tmp/e.groovy
at = org.codehaus.groovy.classgen.AsmClassGenerator.throwException(AsmClassGene= rator.java:718)
at = org.codehaus.groovy.classgen.asm.StatementWriter.writeReturn(StatementWrit= er.java:602)
at = org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeReturn(Opt= imizingStatementWriter.java:368)
at = org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmCla= ssGenerator.java:686)
at = org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:49= )
at = org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(State= mentWriter.java:93)
at = org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeBlockState= ment(OptimizingStatementWriter.java:210)
= at = org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClas= sGenerator.java:636)
at = org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)<= /span>
at = org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(Cl= assCodeVisitorSupport.java:110)
at = org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(C= lassCodeVisitorSupport.java:121)
at = org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGene= rator.java:496)
at = org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(As= mClassGenerator.java:432)
at = org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisit= orSupport.java:132)
at = org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerat= or.java:577)
at = org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1140)
at = org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisito= rSupport.java:54)
at = org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerato= r.java:270)
at = org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:8= 50)
at = org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(Compi= lationUnit.java:1087)
at = org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUn= it.java:631)
at = org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(Compila= tionUnit.java:609)
at = org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:5= 86)
at = groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:354)
at = groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:87)=
at = groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:323)=
at = groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:320)=
at = org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedComm= onCache.java:162)
at = org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCo= mmonCache.java:153)
at = groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:318)
at = groovy.lang.GroovyShell.parseClass(GroovyShell.java:547)
at = groovy.lang.GroovyShell.run(GroovyShell.java:376)
at = groovy.lang.GroovyShell.run(GroovyShell.java:366)
at = groovy.ui.GroovyMain.processOnce(GroovyMain.java:589)
at = groovy.ui.GroovyMain.run(GroovyMain.java:332)
at = groovy.ui.GroovyMain.access$1400(GroovyMain.java:69)
at = groovy.ui.GroovyMain$GroovyCommand.process(GroovyMain.java:291)
at = groovy.ui.GroovyMain.processArgs(GroovyMain.java:134)
at = groovy.ui.GroovyMain.main(GroovyMain.java:116)
at = java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native = Method)
at = java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMetho= dAccessorImpl.java:62)
at = java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Delegat= ingMethodAccessorImpl.java:43)
at = java.base/java.lang.reflect.Method.invoke(Method.java:564)
at = org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:114)=
at = org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:136)

1 error

943 /tmp> groovy = -version
WARNING: = Using incubator modules: jdk.incubator.httpclient
Groovy Version: 3.0.0-alpha-3 JVM: = 10.0.1 Vendor: "Oracle Corporation" OS: Mac OS X
944 /tmp> 
=3D=3D=3D
= --Apple-Mail=_4D20C86A-6750-49E6-97F4-24F1E84B4E04--