What version are you using?
Main
What did you do?
Used a chained associated type alias in my Soroban contract:
use soroban_sdk::{contract, contractimpl, Env};
pub trait Chained {
type Base;
type Foo;
type End;
fn get(env: Env) -> Self::End;
}
#[contract] pub struct Contract;
#[contractimpl]
impl Chained for Contract {
type Base = u64;
type Foo = Self::Base; // alias chain depth 1
type End = Self::Foo; // alias chain depth 2
fn end(env: Env, a: Self::End) -> Self::End { // <-- `a` and return type never resolved to u64
a
}
fn foo(env: Env, a: Self::Foo) -> Self::Foo { // <-- return type never resolved to u64
a
}
}
What did you expect to see?
- A clear compiler error noting I can't use chained associated types like "associated type
Self::End could not be resolved; ensure it is not referenced by another associated type or use the concrete type directly"
- The contract to compile when a single associated type is used as the return value
What did you see instead?
A build error error[E0223]: ambiguous associated type
What version are you using?
Main
What did you do?
Used a chained associated type alias in my Soroban contract:
What did you expect to see?
Self::Endcould not be resolved; ensure it is not referenced by another associated type or use the concrete type directly"What did you see instead?
A build error
error[E0223]: ambiguous associated type