Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home for dartlang.org
« Groups Home
Message from discussion Dealing with naming clashes with multiple interfaces

Received: by 10.180.7.202 with SMTP id l10mr919673wia.4.1335635771367;
        Sat, 28 Apr 2012 10:56:11 -0700 (PDT)
X-BeenThere: m...@dartlang.org
Received: by 10.180.87.234 with SMTP id bb10ls1386762wib.4.gmail; Sat, 28 Apr
 2012 10:56:07 -0700 (PDT)
Received: by 10.180.24.35 with SMTP id r3mr16045498wif.7.1335635767824;
        Sat, 28 Apr 2012 10:56:07 -0700 (PDT)
Received: by 10.180.24.35 with SMTP id r3mr16045488wif.7.1335635767785;
        Sat, 28 Apr 2012 10:56:07 -0700 (PDT)
Return-Path: <fo...@univ-mlv.fr>
Received: from monge.univ-mlv.fr (monge.univ-mlv.fr. [193.55.63.80])
        by mx.google.com with ESMTPS id u74si12663783weq.0.2012.04.28.10.56.07
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sat, 28 Apr 2012 10:56:07 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of fo...@univ-mlv.fr designates 193.55.63.80 as permitted sender) client-ip=193.55.63.80;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of fo...@univ-mlv.fr designates 193.55.63.80 as permitted sender) smtp.mail=fo...@univ-mlv.fr
Received: from localhost.localdomain (pon77-1-88-167-50-47.fbx.proxad.net [88.167.50.47])
	(authenticated bits=0)
	by monge.univ-mlv.fr (8.14.2/8.14.2) with ESMTP id q3SHu7Uh024543
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO)
	for <m...@dartlang.org>; Sat, 28 Apr 2012 19:56:07 +0200
Message-ID: <4F9C2FB1.7000003@univ-mlv.fr>
Date: Sat, 28 Apr 2012 19:58:09 +0200
From: =?UTF-8?B?UsOpbWkgRm9yYXg=?= <fo...@univ-mlv.fr>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1
MIME-Version: 1.0
To: m...@dartlang.org
Subject: Re: [misc] Dealing with naming clashes with multiple interfaces
References: <29b6a10f-8a94-4095-be0b-e09fba591bee@e9g2000yqm.googlegroups.com> <CACr=8_NCEXhK6kMuhN2veWkQ=JER-TkXqMe1kidnddS=oo_3kA@mail.gmail.com> <CAF4-3f=+D3oVD3+PrX=Dzjhae2ocfwrGZwoJ7+Ca85Od8_0Lmg@mail.gmail.com>
In-Reply-To: <CAF4-3f=+D3oVD3+PrX=Dzjhae2ocfwrGZwoJ7+Ca85Od8_0Lmg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 04/28/2012 06:20 PM, Chris Buckett wrote:
> Aah, let me clarify a bit more :)
>
> at present, if two separate interfaces declare the
> same method name /with different method signatures/
> there is no way for a single class to implement both
> the interfaces at the same time.
>
> Cheers,
> Chris.

Not exactly true, this by example works thanks to the unsound typesystem

interface A {
   m(A a);
}
interface B {
   m(B b);
}

class C implements A, B {
   m(A a) {
     if (this == a) {
       print('Ok !');
     }
   }
}

main() {
   A a = new C();
   a.m(a);
   B b = new C();
   b.m(b);
}

Rémi

>
>
>
> On 28 April 2012 17:12, Seth Ladd <sethl...@google.com 
> <mailto:sethl...@google.com>> wrote:
>
>     Hi Chris,
>
>     If you change B.go(name) to B.go() the static analyzer will stop
>     complaining. I tested in the Dart Editor.
>
>     Seth
>
>
>     On Sat, Apr 28, 2012 at 9:03 AM, Chris Buckett
>     <chrisbuck...@gmail.com <mailto:chrisbuck...@gmail.com>> wrote:
>
>         Hi,
>
>         Quick question, at present, if two separate interfaces declare the
>         same method name, there is no way for a single class to
>         implement both
>         the interfaces at the same time.
>
>         eg: http://try.dartlang.org/s/bEo8
>
>         Is there any way planned around this (eg, name prefixes or
>         similar? )
>
>         Cheers,
>         Chris.
>
>
>