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
docker run --security-opt seccomp=unconfined -it --rm --name swift -e 'LC_ALL=C.UTF-8' swiftlang/swift:nightly-5.5 /bin/bash
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: f918dbf122e7e459031f1b35ceaecd56
Issue Description:
When using the main actor in combination with Never, I get an incorrect warning that the function that definitely executes, will never execute:
import Foundation
@MainActorfunc bye()->Never{print("bye")exit(0)}Task{awaitbye()}dispatchMain()
The above program, when executed with the appropriate experimental flags, outputs:
root@59ad8f68151e:/mnt/src# ./swift.sh actor-never.swift
actor-never.swift:10:8: warning: will never be executed
await bye()
^
actor-never.swift:10:8: note: a call to a never-returning function
await bye()
^
bye
root@59ad8f68151e:/mnt/src#
..even though the bye function clearly executes. If I alter the signature of bye to
func bye()async->Never
the problem goes away, and the program just outputs "bye".
For reference, swift.sh contains:
#!/bin/sh
swift -Xfrontend -enable-experimental-concurrency "$@"
The text was updated successfully, but these errors were encountered:
Environment
Windows 10 1909, docker WSL2 command line:
Additional Detail from JIRA
md5: f918dbf122e7e459031f1b35ceaecd56
Issue Description:
When using the main actor in combination with Never, I get an incorrect warning that the function that definitely executes, will never execute:
The above program, when executed with the appropriate experimental flags, outputs:
..even though the bye function clearly executes. If I alter the signature of bye to
the problem goes away, and the program just outputs "bye".
For reference, swift.sh contains:
The text was updated successfully, but these errors were encountered: