Open swift-ci opened 3 years ago
On master, the compiler doesn't hang for me and produces the following diagnostics:
/Users/spare/Desktop/test.swift:9:25: error: cannot find 'totalseconds' in scope
let hours = totalseconds / 3600
^~~~~~~~~~~~
/Users/spare/Desktop/test.swift:10:29: error: cannot find 'totalseconds' in scope
let remaining = totalseconds % 3600
^~~~~~~~~~~~
/Users/spare/Desktop/test.swift:7:9: error: type of expression is ambiguous without more context
HStack {
^~~~~~~~
/Users/spare/Desktop/test.swift:20:25: error: missing argument for parameter 'interval' in call
TimeElapsedView()
^
interval: <#DateInterval#>
/Users/spare/Desktop/test.swift:3:8: note: 'init(interval:)' declared here
struct TimeElapsedView: View {
^
Could you verify using the latest trunk snapshot from swift.org?
Comment by Damian Mehers (JIRA)
Looks better with 16 Jul dev snapshot:
damian@Damians-iMac-Pro-3 ~ % swift --version
Apple Swift version 5.3 (swiftlang-1200.0.16.13 clang-1200.0.22.25)
Target: x86_64-apple-darwin19.6.0
damian@Damians-iMac-Pro-3 ~ % swift /Users/damian/Downloads/test/test/ContentView.swift
/Users/damian/Downloads/test/test/ContentView.swift:9:25: error: cannot find 'totalseconds' in scope
let hours = totalseconds / 3600
^~~~~~~~~~~~
/Users/damian/Downloads/test/test/ContentView.swift:10:29: error: cannot find 'totalseconds' in scope
let remaining = totalseconds % 3600
^~~~~~~~~~~~
// HANGING
^C
damian@Damians-iMac-Pro-3 ~ % export PATH=/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2020-07-16-a.xctoolchain/usr/bin::"${PATH}"
damian@Damians-iMac-Pro-3 ~ % swift --version
Apple Swift version 5.3-dev (LLVM a2e0564af78e841, Swift 1224d8b2d312c55)
Target: x86_64-apple-darwin19.6.0
damian@Damians-iMac-Pro-3 ~ % swift /Users/damian/Downloads/test/test/ContentView.swift
/Users/damian/Downloads/test/test/ContentView.swift:9:25: error: cannot find 'totalseconds' in scope
let hours = totalseconds / 3600
^~~~~~~~~~~~
/Users/damian/Downloads/test/test/ContentView.swift:10:29: error: cannot find 'totalseconds' in scope
let remaining = totalseconds % 3600
^~~~~~~~~~~~
/Users/damian/Downloads/test/test/ContentView.swift:7:9: error: type of expression is ambiguous without more context
HStack {
^~~~~~~~
/Users/damian/Downloads/test/test/ContentView.swift:20:25: error: missing argument for parameter 'interval' in call
TimeElapsedView()
^
interval: <#DateInterval#>
/Users/damian/Downloads/test/test/ContentView.swift:3:8: note: 'init(interval:)' declared here
struct TimeElapsedView: View {
^
damian@Damians-iMac-Pro-3 ~ %
Attachment: Download
Environment
Xcode Version 12.0 beta 2 (12A6163b) Apple Swift version 5.3 (swiftlang-1200.0.16.13 clang-1200.0.22.25) Target: x86_64-apple-darwin19.6.0Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, TypeChecker | |Assignee | None | |Priority | Medium | md5: 58be4b51ed610315d0ccc118ec7f11f6Issue Description:
I'm getting a hang compiling the attached invalid code:
/Applications/Xcode_12_beta_2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift /Users/damian/Downloads/test/test/ContentView.swift
/Users/damian/Downloads/test/test/ContentView.swift:9:25: error: cannot find 'totalseconds' in scope
let hours = totalseconds / 3600
^\~\~\~\~\~\~\~\~\~\~\~
/Users/damian/Downloads/test/test/ContentView.swift:10:29: error: cannot find 'totalseconds' in scope
let remaining = totalseconds % 3600
^\~\~\~\~\~\~\~\~\~\~\~
...hangs