On 02.05.22 21:17, Stanislav Blinov wrote:
On Monday, 2 May 2022 at 16:29:05 UTC, Loara wrote:
[...]
```d
    template MyAlias(T){
      alias MyAlias = int;
    }

    T simp(T)(MyAlias!T val){
      return T.init;
    }

    int main(){
      simp(3);//Impossible to deduce T

Why? That's the issue. It is very possible to deduce T here. Compiler just isn't trying. The function takes an int. Doesn't take a rocket scientist to figure that one out.

I take it your answer is that T must be int. But that's nonsense. MyAlias maps all types to int. It's not a bijection, you can't turn it around.

Reply via email to