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

scope(...).export() does not preserve the name of a type used for the scope's parameter if one is explicitly defined #1168

Open
Dimava opened this issue Oct 11, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Dimava
Copy link
Contributor

Dimava commented Oct 11, 2024

πŸ§‘β€πŸ’» Repro

import type { Scope } from 'arktype'
import { scope } from 'arktype'

const _$ = scope({
  username: 'string.alpha',
})
type Identity<T> = T
export interface $ extends Identity<typeof _$.t> { }
export const $ = _$ as any as Scope<$>

const x = $.type('username')
//    ^?
// const x: Type<string.alpha, $>
const y = $.export().username
//    ^?
// const y: Type<string.alpha, { username: string.alpha; }>
@Dimava Dimava added the bug Something isn't working label Oct 11, 2024
@github-project-automation github-project-automation bot moved this to To do in arktypeio Oct 11, 2024
@ssalbdivad ssalbdivad changed the title scope(...).export() does not maintain generic argument scope(...).export() does not preserve the name of a type used for the scope's parameter if one is explicitly defined Oct 11, 2024
@ssalbdivad ssalbdivad added enhancement New feature or request and removed bug Something isn't working labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants