Skip to content

Versioning does not detect dependency when library references versioned library through is #1828

Description

@tjprescott

Original issue: Azure/typespec-azure#2598

Playground

@versioned(MyVersions)
namespace MyLib {
  enum MyVersions {
    v1: "1",
    v2: "2",
  }

  // Correctly throws an error
  model MyFoo extends VersionedLib.Foo {};

  // All of these should trigger the error that @useDependency is required!
  model MyFoo is VersionedLib.Foo;
  alias MyFooAlias = VersionedLib.Foo;
  op FooOp is VersionedLib.FooOperation<{name: string}, string>;
  alias FooOperationAlias<TParam, TResponse> = VersionedLib.FooOperation<TParam, TResponse>;
}

It seems clear to me in this instances that if your library is using "is" or aliasing things from a versioned library, then you are taking a dependency on the source library, but existing logic does not pick that up.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions