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

Codegen: type named Type can't be targeted by a list #1618

Open
kubukoz opened this issue Nov 1, 2024 · 0 comments
Open

Codegen: type named Type can't be targeted by a list #1618

kubukoz opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kubukoz
Copy link
Member

kubukoz commented Nov 1, 2024

$version: "2"

namespace hello

string Type

list Types {
    member: Type
}

Result:

[info] compiling 3 Scala sources to /Users/kubukoz/projects/demos/target/scala-3.5.2/classes ...
[error] -- [E007] Type Mismatch Error: /Users/kubukoz/projects/demos/target/scala-3.5.2/src_managed/main/smithy4s/hello/Types.scala:13:82 
[error] 13 |  val underlyingSchema: Schema[List[Type]] = list(Type.schema).withId(id).addHints(hints)
[error]    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |                Found:    smithy4s.schema.Schema[List[hello.Type.T]]
[error]    |                Required: smithy4s.schema.Schema[List[hello.Types.Type]]
[error]    |
[error]    | longer explanation available when compiling with `-explain`
[error] -- [E007] Type Mismatch Error: /Users/kubukoz/projects/demos/target/scala-3.5.2/src_managed/main/smithy4s/hello/Types.scala:14:67 
[error] 14 |  implicit val schema: Schema[Types] = bijection(underlyingSchema, asBijection)
[error]    |                                                                   ^^^^^^^^^^^
[error]    |Found:    (hello.Types.asBijection :
[error]    |  smithy4s.Bijection[List[hello.Type], hello.Types.Type²])
[error]    |Required: smithy4s.Bijection[List[hello.Types.Type²], hello.Types.T]
[error]    |
[error]    |where:    Type  is a type in package object hello which is an alias of hello.Type.Type²
[error]    |          Type² is a type in class Newtype which is an alias of Newtype.this.T
[error]    |
[error]    | longer explanation available when compiling with `-explain`
[error] two errors found
[error] (Compile / compileIncremental) Compilation failed
@kubukoz kubukoz added the bug Something isn't working label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant