Skip to content

[SR-9316] libSyntax: @convention function type is not supported in all contexts #51786

@dan-zheng

Description

@dan-zheng
Previous ID SR-9316
Radar None
Original Reporter @dan-zheng
Type Bug
Environment

Swift built from this commit: ab37099

Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, Syntax
Assignee None
Priority Medium

md5: 34a2083c388b96b7ef7fc883dadbf305

Issue Description:

Simple reproducer:

// convention.swift
// This passes syntax verification.
let f: @convention(c) (Int) -> Int = { x in x }

func foo<T>(_ x: T.Type) {}
// This does not.
foo((@convention(c) (Int) -> Int).self)
$ swiftc -Xfrontend -verify-syntax-tree convention.swift
convention.swift:6:6: error: unknown expression syntax exists in the source
foo((@convention(c) (Int) -> Int).self)
     ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    @conventionFeature → attributes: the @convention attributeattributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.function typesFeature → types: function typessource toolingArea: IDE support, SourceKit, and other source toolingstaleResolution: No longer relevant, staletypesFeature: typesunexpected errorBug: Unexpected error† libswiftSyntaxArchive • Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions