swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.3k stars 10.34k forks source link

source compatibility project violet fails with a compiler error #75499

Open eeckstein opened 1 month ago

eeckstein commented 1 month ago

Description

/build/swift-source-compat-suite/project_cache/violet/Sources/Compiler/Implementation/CompilerImpl+Expr.swift:14:31: error: 'Expression' is ambiguous for type lookup in this context
 12 | extension CompilerImpl {
 13 | 
 14 |   internal func visit(_ node: Expression) throws {
    |                               `- error: 'Expression' is ambiguous for type lookup in this context
 15 |     self.setAppendLocation(node)
 16 |     try node.accept(self)

Reproduction

builds: https://ci.swift.org/job/swift-6.0-source-compat-suite-debug-ubuntu-2004/121/ https://ci.swift.org/job/swift-6.0-source-compat-suite-ubuntu-2004/121/ https://ci.swift.org/job/swift-source-compat-suite-debug-ubuntu-2004/499/ https://ci.swift.org/job/swift-source-compat-suite-ubuntu-2004/599/

log: https://ci.swift.org/job/swift-6.0-source-compat-suite-debug-ubuntu-2004/121/artifact/build/swift-source-compat-suite/FAIL_violet_5.3_BuildSwiftPackage.log

Expected behavior

should build fine

Environment

CI

Additional information

No response

AnthonyLatsis commented 1 month ago

Could this error actually be legit due to https://forums.swift.org/t/review-sf-0006-expression-macro-and-type/70211? Now there are two distinct extramodular Expression decls visible in this file — one from import Foundation and the other from import VioletParser.

jmschonfeld commented 1 month ago

Yes @AnthonyLatsis I believe you're correct. I think the module that imports both Foundation and VioletParser will need to be updated to disambiguate between the two types (either via fully qualified names, or via a typealias)

AnthonyLatsis commented 1 month ago

@xedin Since by all appearances this is not a compiler issue, could you please transfer it to the compat suite?