This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/20312] New: No warning on bad method
- From: "davidw at dedasys dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Mar 2005 08:19:06 -0000
- Subject: [Bug java/20312] New: No warning on bad method
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi, in the Hecl programming language, I do this:
public String toString() throws HeclException {
Vector v = ListThing.get(new Thing(new HashThing(val)));
ListThing newthing = new ListThing(v);
return newthing.toString();
}
Apparently, that should generate a warning or throw an error, because toString
isn't supposed to throw an exception... "regular" java says this:
./com/dedasys/hecl/HashThing.java:140: toString() in com.dedasys.hecl.HashThing
cannot override toString() in java.lang.Object; overridden method does not throw
com.dedasys.hecl.HeclException
public String toString() throws HeclException {
^
Thanks,
Dave
--
Summary: No warning on bad method
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: davidw at dedasys dot com
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20312