You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-ci opened this issue
Oct 31, 2019
· 5 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
Target: x86_64-apple-darwin18.7.0
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug, CompilerCrash
Assignee
None
Priority
Medium
md5: f77639cad06f6074facf5d8fca7ac215
duplicates:
SR-11636 Accessing covariant Self from stored property initializer in extension segfaults
Issue Description:
I get a compiler segfault trying to compile this snippet:
finalclassClass {
// This would correctly give the compiler error:// /Users/limalex/workspace/SwiftCompilerCrashExample/SwiftCompilerCrashExample/main.swift:12:28: Covariant 'Self' type cannot be referenced from a stored property initializer// static let something = Self.self
}
extensionClass {
// This could be any reference to `Self` and it would crash (i.e. I could try to call some static method on `Class`).staticletsomething = Self.self
}
/Users/suyashsrijan/Desktop/test.swift:9:16: error: unexpected error produced: covariant 'Self' can only appear at the top level of property type
static let something = Self.self
^
/Users/suyashsrijan/Desktop/test.swift:9:16: error: unexpected error produced: stored property cannot have covariant 'Self' type
static let something = Self.self
^
/Users/suyashsrijan/Desktop/test.swift:9:16: error: unexpected error produced: covariant 'Self' can only appear at the top level of method result type
Yeah, it's not fixed on 5.1 but it's fixed on master, so this should get diagnosed as expected in Swift 5.2. You can verify using a development snapshot from swift.org.
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Environment
Xcode 11 GM Seed 2, Version 11.0 (11A420a)
macOS Mojave Version 10.14.6
MacBook Pro (Retina, 15-inch, Mid 2015) 2.8 GHz Intel Core i7
Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
Target: x86_64-apple-darwin18.7.0
Additional Detail from JIRA
md5: f77639cad06f6074facf5d8fca7ac215
duplicates:
Self
from stored property initializer in extension segfaultsIssue Description:
I get a compiler segfault trying to compile this snippet:
Stack trace:
Expected: I get a compiler error for trying to refer to `Self` in a stored property initializer.
Actual: The compiler segfaults.
The text was updated successfully, but these errors were encountered: