Accessing a property of an uninitialized instance results in a Runtime error #70908
Labels
accepts invalid
Bug: Accepts invalid
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
crash
Bug: A crash, i.e., an abnormal termination of software
definite initialization
Area → compiler → SIL: Definite initialization
duplicate
Resolution: Duplicates another issue
memory safety
Feature: memory safety
script mode
Flag: Specific to script mode compilation
SIL
swift 6.0
Description
The code produces a runtime error instead of a compile-time error. I would anticipate this to be an error that could be identified during compile-time.
It's worth mentioning that removing the
printand having justinstance.xallows the compiled binary to execute without any runtime errors (exit code 0).Reproduction
Expected behavior
I expect this to be a compile-time error
Environment
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: