microsoft / typespec

https://typespec.io/
MIT License
4.5k stars 214 forks source link

[Bug]: [Ask]Ambiguous-symbol "nextLink" is an ambiguous name between TypeSpec.nextLink, Azure.Core.nextLink #5048

Open MaryGao opened 2 days ago

MaryGao commented 2 days ago

Describe the bug

With below spec we received 1 errors with Ambiguous-symbol "nextLink" is an ambiguous name between TypeSpec.nextLink, Azure.Core.nextLink. I think this is because we both have nextLink decoration in TypeSpec and Azure.Core scope. And adding prefix could fix this issue. But I was wondering following questions regarding these decorators.

playground

@pagedResult
model Bar {
  @items
  items: string[];

  @nextLink
  nextLink: url;
}

// vs

model Page<T> {
  @nextLink nextLink: url;

  @pageItems
  items: T[];
}

@list op Foo(): Page<string>;

Reproduction

NA

Checklist

MaryGao commented 2 days ago

Another question is if we could accept array as paged items directly for list operation? Previouly this is acceptable.

playground Image