-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfdeclarationsFeature: declarationsFeature: declarationsextensionFeature → declarations: `extension` declarationsFeature → declarations: `extension` declarationsimportFeature → declarations: `import` declarationsFeature → declarations: `import` declarationsmultiple modulesFlag: An issue whose reproduction requires multiple modulesFlag: An issue whose reproduction requires multiple modulesname lookupArea → compiler → type checker: Name lookupArea → compiler → type checker: Name lookupswift 5.9swift evolution implementedFlag → feature: A feature that was approved through the Swift evolution process and implementedFlag → feature: A feature that was approved through the Swift evolution process and implementedunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
Previous ID | SR-3908 |
Radar | rdar://problem/16154294 |
Original Reporter | @aciidb0mb3r |
Type | Bug |
Attachment: Download
Additional Detail from JIRA
Votes | 9 |
Component/s | Compiler |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: 7cc3dd991a1637efb2f2ca9e6d75b83d
is duplicated by:
- [SR-4521] Framework extensions are accessible inside file without
import
#47098 - [SR-4654] Struct extension implicitly imported from framework #47231
- [SR-8353] Public extensions of shared types in a framework are visible without importing it #50881
- [SR-9913] Transitive dependencies and extensions of standard types #52319
Issue Description:
The attached package contains three targets:
foo
- defines aVersion
struct which can be initialized by a string param.bar
- depends on foo and defines an extension with an initializer toVersion
with no parametersexe
- depends on foo and bar and has two files.
- other.swift - imports
bar
- main.swift - imports
foo
and callsVersion()
This should not compile or run because Version()
is defined in bar
and bar
is not imported in main.swift
.
It works as expected after removing import bar
from other.swift
(needs a swift package clean though).
erichoracek, kulich-ua, PoshAlpaca, q231950, waliid and 2 more
Metadata
Metadata
Assignees
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfdeclarationsFeature: declarationsFeature: declarationsextensionFeature → declarations: `extension` declarationsFeature → declarations: `extension` declarationsimportFeature → declarations: `import` declarationsFeature → declarations: `import` declarationsmultiple modulesFlag: An issue whose reproduction requires multiple modulesFlag: An issue whose reproduction requires multiple modulesname lookupArea → compiler → type checker: Name lookupArea → compiler → type checker: Name lookupswift 5.9swift evolution implementedFlag → feature: A feature that was approved through the Swift evolution process and implementedFlag → feature: A feature that was approved through the Swift evolution process and implementedunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output