We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 554842305cf65cdd81ba04504e0ae869
Issue Description:
Write this in the REPL line-by-line:
protocol P: AnyObject {} extension Int: P {} // you'll get an error here. 42 is P
The REPL will first say that the line '42 is P' is always true, then crash:
Could not cast value of type 'Swift.Int' (0x11be12708) to 'REPL_3.P' (0x11be49fa8). ... 0 swift 0x0000000112d8f978 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 1 swift 0x0000000112d8ebf5 llvm::sys::RunSignalHandlers() + 85 2 swift 0x0000000112d8ff82 SignalHandler(int) + 258 3 libsystem_platform.dylib 0x00007fff5f56cb3d _sigtramp + 29 4 libsystem_platform.dylib 0x00007fe0d0e44760 _sigtramp + 1905097792 5 libsystem_c.dylib 0x00007fff5f42a1c9 abort + 127 6 libswiftCore.dylib 0x000000011bd4a075 swift::fatalError(unsigned int, char const*, ...) + 149 7 libswiftCore.dylib 0x000000011bd40d12 swift::swift_dynamicCastFailure(void const*, char const*, void const*, char const*, char const*) + 82 8 libswiftCore.dylib 0x000000011bd40d8a swift::swift_dynamicCastFailure(swift::TargetMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, char const*) + 106 9 libswiftCore.dylib 0x000000011bd451b0 _dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 2528 10 libswiftCore.dylib 0x000000011a92d046 _dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 4273899638 11 swift 0x000000010e544c8d llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 461
Even though the "Int: P" conformance is invalid, it appears to still be available for type-checking.
The text was updated successfully, but these errors were encountered:
Lousy, but not a priority. The integrated REPL is just for compiler engineers testing things.
Sorry, something went wrong.
Also happens in LLDB REPL.
Tested on Apple Swift version 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1) and master.
Doesn't reproduce on top-of-tree for the integrated REPL and the LLDB REPL.
local@locals-iMac-Pro-3 ~ % ./swift/build/Ninja-ReleaseAssert+stdlib-Release/swift-macosx-x86_64/bin/swift *** You are running Swift's integrated REPL, *** *** intended for compiler and stdlib *** *** development and testing purposes only. *** *** The full REPL is built as part of LLDB. *** *** Type ':help' for assistance. *** (swift) protocol P: AnyObject {} (swift) extension Int: P {} <REPL Input>:1:1: error: non-class type 'Int' cannot conform to class protocol 'P' extension Int: P {} ^
local@locals-iMac-Pro-3 ~ % ./swift/build/Ninja-ReleaseAssert+stdlib-Release/lldb-macosx-x86_64/bin/lldb --repl Welcome to Swift version 5.1-dev (LLVM 200186e28b, Swift a8dc4be076). Type :help for assistance. 1> protocol P: AnyObject {} 2> extension Int: P {} error: repl.swift:2:1: error: non-class type 'Int' cannot conform to class protocol 'P' extension Int: P {} ^
No branches or pull requests
Additional Detail from JIRA
md5: 554842305cf65cdd81ba04504e0ae869
Issue Description:
Write this in the REPL line-by-line:
The REPL will first say that the line '42 is P' is always true, then crash:
Even though the "Int: P" conformance is invalid, it appears to still be available for type-checking.
The text was updated successfully, but these errors were encountered: