Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Windows Phone/Store: Ambiguous reference #44

Closed
movrajr opened this issue Dec 24, 2014 · 2 comments
Closed

Windows Phone/Store: Ambiguous reference #44

movrajr opened this issue Dec 24, 2014 · 2 comments

Comments

@movrajr
Copy link
Contributor

movrajr commented Dec 24, 2014

Some people have reported "ambiguous reference between 'System.IObserver<UniRx.Unit>' and 'UniRx.IObserver<UniRx.Unit>". That happens when UniRx is compiled with the Microsoft compiler, ie.:

  • IObserver is used without UniRx namespace
  • build platform is set to Windows Phone or Windows Store
  • UniRx is not located in “Assets/Plugins”, “Assets/Standard Assets” and “Assets/Pro Standard Assets”

http://docs.unity3d.com/Manual/wp8-1-faq.html

I think this can be fixed by:

  • removing UniRx.IObserver from Observer.cs

  • creating a new file called IObserver.cs

  • put this in the file

    if !NETFX_CORE

    using System;

    namespace System
    {
    public interface IObserver
    {
    void OnNext(T value);
    void OnError(Exception error);
    void OnCompleted();
    }
    }

    endif

Drawback: any code code that referred to the interface with its fully qualified name "UniRx.IObserver" will break.

@neuecc
Copy link
Owner

neuecc commented Dec 26, 2014

Thank you.

Tuple and IProgress have same problem.
Syste.IObserver[T] may not conflict but System.Tuple may conflict with other assets.
So I want to avoid use System namespace.

How about keep UniRx namespace and remove if NETFX_CORE?

#if !NETFX_CORE

namespace UniRx
{
    public interface IObserver<T>
    {
        void OnNext(T value);
        void OnError(Exception error);
        void OnCompleted();
    }

    // Tuple, IProgress, etc...
}

#endif

We can not use fully qualified name for compatibility with WP and others.
However, I can permit it because probably there are few people use it.
...maybe.

@movrajr
Copy link
Contributor Author

movrajr commented Apr 8, 2015

I'm just going to close this issue since it has been a few months. I can't verify the fix at the moment, but I'll assume it's OK.

@movrajr movrajr closed this as completed Apr 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants