Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssociatedTypeのTrait指定にしたことによる挙動の変化 #96

Open
1 task
niuez opened this issue Nov 16, 2021 · 0 comments
Open
1 task

AssociatedTypeのTrait指定にしたことによる挙動の変化 #96

niuez opened this issue Nov 16, 2021 · 0 comments

Comments

@niuez
Copy link
Owner

niuez commented Nov 16, 2021

  • traitとimplのcheck_equal時に::Outputがたくさんあって見つからないかも
    • いまチェックしているトレイトのプライオリティを最大に引き上げればよさそう
    • → 下の例の場合に使えない 違う方法を考える
struct Hoge {} {}

trait Tr1 {
  type TrAsso;
  fn tr1() -> Self::TrAsso;
}

trait Tr2 {
  type TrAsso;
  fn tr2() -> Self::TrAsso;
}

impl Tr1 for Hoge {
  type TrAsso = u64;
  fn tr1() -> u64 { 0 }
}

impl Tr2 for Hoge {
  type TrAsso = i64;
  fn tr2() -> i64 { 1i64 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant