Skip to content

Superinterfaces' members with the same name should produce a static warning #3306

@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


What steps will reproduce the problem?
Run the following test with dartc:

interface SI1 {
  void foo(var v, [int foo, int bar]);
}

interface SI2 {
  void foo(var v, [int foo, int b4r]);
}

interface I extends SI1, SI2 {}

main() {
  I i = null;
  i.foo(null, null, null);
}

What is the expected output? What do you see instead?
According to the section 8.4.1 of the specification: "if there are multiple members m1, …, mk with the same name n that would be inherited (because identically named members existed in several superinterfaces) then at most one member is inherited. If the static types T1, …, Tk of the members m1, …, mk are not identical, then there must be a member mx such that Tx <: Ti, 1 <= x <= k for all i, 1 <= i <= k, or a static type warning occurs."
So, expected result is a static warning, since foo of S1 and foo of S2 have different types and none of them is a subtype of another.
Actual result: dartc does not produce a static warning.

What version of the product are you using? On what operating system?
Dartc, r8088. OS Ubuntu 10.04

Please provide any additional information below.
co19 tests:
Language/08_Interfaces/4_Superinterfaces/1_Inheritance_and_Overriding_A02_t01.dart
Language/08_Interfaces/4_Superinterfaces/1_Inheritance_and_Overriding_A02_t03.dart
Language/08_Interfaces/4_Superinterfaces/1_Inheritance_and_Overriding_A02_t04.dart
 Language/08_Interfaces/4_Superinterfaces/1_Inheritance_and_Overriding_A02_t04.dart

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-obsoleteClosed as the reported issue is no longer relevantlegacy-area-analyzerUse area-devexp instead.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions