Skip to content

Generic argument list incorrectly allowed on typealias metatype value #74895

@AnthonyLatsis

Description

@AnthonyLatsis

Description

No response

Reproduction

typealias A = Int
func foo(_ meta: A.Type) {
  // No error.
  let _ = meta<Bool>.self
}

Expected behavior

An error stating that parameter meta cannot be specialized. Or better yet, an error stating that only references to generic type and macro declarations may be specialized.

Environment

Swift version 6.0-dev (LLVM c7c87ee42989d4b, Swift 8493312)
Target: x86_64-apple-darwin23.5.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepts invalidBug: Accepts invalidbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfexpressionsFeature: expressionsgenericsFeature: generic declarations and typesmetatypesFeature → types: Metatypesregressionswift 6.0type checkerArea → compiler: Semantic analysistype declarationsFeature → declarations: Type declarationstypealiasFeature → type declarations: `typealias` declarationstypesFeature: types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions