Ticket #268 (new defect)

Opened 1 year ago

Interface Implementation Doesn't Inspect Method Arguments

Reported by: jresig Assigned to: anonymous
Type: defect Priority: major
Milestone: Component: RefImpl
Version: 4 Keywords:
Cc:

Description

When implementing an interface the arguments of implemented methods aren't inspected, and verified. (This assumption is based off of the fact stated in the wiki and as shown in the Overview White Paper.)

For example, the following works just fine:

>> interface Foo { function bar() }
>> class Bar implements Foo { }
**ERROR** DefnError: unimplemented interface method [ns public '']::bar  (near <no filename>:1:1-1.5)
>> class Bar implements Foo { function bar() { } }

But when implementing the bar() method with an argument (which doesn't match the interface) no exception is thrown:

>> class Baz implements Foo { function bar(x:int) { } }

Another example:

>> interface Foo { function bar(x:int) }
>> class Bar implements Foo { function bar(){} }

Attachments

Note: See TracTickets for help on using tickets.