-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarekey pathsFeature: key paths (both native and Objective-C)Feature: key paths (both native and Objective-C)type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Previous ID | SR-6300 |
Radar | rdar://problem/35368903 |
Original Reporter | @stephencelis |
Type | Bug |
Status | Resolved |
Resolution | Done |
Environment
November 4 Swift Trunk Snapshot
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, CompilerCrash, KeyPaths, TypeChecker |
Assignee | @AnnaZaks |
Priority | Medium |
md5: 3886fb02f71ca8ac991f7cf076ec23f2
is duplicated by:
- SR-6311 Array subscript takes any KeyPath and leads to undefined behavior and crashes
relates to:
- SR-6311 Array subscript takes any KeyPath and leads to undefined behavior and crashes
Issue Description:
The following code crashes the compiler.
struct Foo { let foo: Int }
struct Bar { let bar: String }
Bar(bar: "Hello!")[keyPath: \Foo.foo]
The crash:
TYPE MISMATCH IN ARGUMENT 0 OF APPLY AT expression at
RangeText="Bar(bar: "Hello!")[keyPath: \Foo.foo]"
Ideally this is a normal compiler error, instead.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarekey pathsFeature: key paths (both native and Objective-C)Feature: key paths (both native and Objective-C)type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis