I just found a major regression bug in Swift 2.2 (it’s tracked under SR-706 <https://bugs.swift.org/browse/SR-706>\). Since Swift 2.2 development seems to come to an end I wanted to raise some attention for this bug by posting it here as well.
- Alex
When using the generic argument of a function as a parameter of another generic class that is used in the signature, the compiler crashes with Illegal instruction: 4
<>Example
class GenericClass<T> { }
protocol MyProtocol { }
class MyClass {
func myFunction<T, O: GenericClass<T> where T: MyProtocol>(myArg: O) -> T {
fatalError()
}
}
<>Interesting crash facts
This used to work with Swift 2.1
This works with the version of Swift that is shipped with Xcode 7.3 beta 2 (7D129n)
It crashes the Swift 2.2 and Swift 3 compiler since the snapshot of 01/11/2016 (that’s the oldest snapshot I have installed)
The code compiles fine with the current master (as of 02/10/2016, commit 073df63) iff myFunction is a global function and not a method in a class
I’m pretty sure Joe Groff pushed a fix for this yesterday (it landed in swift-2.2-branch with 9e9537 and master as c165811). I’ll double-check.
Thanks!
- Joe
···
On Feb 9, 2016, at 11:56 PM, Alex Hoppen via swift-dev <swift-dev@swift.org> wrote:
Hi everyone,
I just found a major regression bug in Swift 2.2 (it’s tracked under SR-706 <https://bugs.swift.org/browse/SR-706>\). Since Swift 2.2 development seems to come to an end I wanted to raise some attention for this bug by posting it here as well.
- Alex
When using the generic argument of a function as a parameter of another generic class that is used in the signature, the compiler crashes with Illegal instruction: 4
<>Example
class GenericClass<T> { }
protocol MyProtocol { }
class MyClass {
func myFunction<T, O: GenericClass<T> where T: MyProtocol>(myArg: O) -> T {
fatalError()
}
}
<>Interesting crash facts
This used to work with Swift 2.1
This works with the version of Swift that is shipped with Xcode 7.3 beta 2 (7D129n)
It crashes the Swift 2.2 and Swift 3 compiler since the snapshot of 01/11/2016 (that’s the oldest snapshot I have installed)
The code compiles fine with the current master (as of 02/10/2016, commit 073df63) iff myFunction is a global function and not a method in a class
_______________________________________________
swift-dev mailing list
swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev
I'm not certain that yesterday's fix would cover this case.
-Joe
···
On Feb 10, 2016, at 9:20 AM, Joe Pamer via swift-dev <swift-dev@swift.org> wrote:
Hi Alex,
I’m pretty sure Joe Groff pushed a fix for this yesterday (it landed in swift-2.2-branch with 9e9537 and master as c165811). I’ll double-check.
Thanks!
- Joe
On Feb 9, 2016, at 11:56 PM, Alex Hoppen via swift-dev <swift-dev@swift.org <mailto:swift-dev@swift.org>> wrote:
Hi everyone,
I just found a major regression bug in Swift 2.2 (it’s tracked under SR-706 <https://bugs.swift.org/browse/SR-706>\). Since Swift 2.2 development seems to come to an end I wanted to raise some attention for this bug by posting it here as well.
- Alex
When using the generic argument of a function as a parameter of another generic class that is used in the signature, the compiler crashes with Illegal instruction: 4
<>Example
class GenericClass<T> { }
protocol MyProtocol { }
class MyClass {
func myFunction<T, O: GenericClass<T> where T: MyProtocol>(myArg: O) -> T {
fatalError()
}
}
<>Interesting crash facts
This used to work with Swift 2.1
This works with the version of Swift that is shipped with Xcode 7.3 beta 2 (7D129n)
It crashes the Swift 2.2 and Swift 3 compiler since the snapshot of 01/11/2016 (that’s the oldest snapshot I have installed)
The code compiles fine with the current master (as of 02/10/2016, commit 073df63) iff myFunction is a global function and not a method in a class
_______________________________________________
swift-dev mailing list
swift-dev@swift.org <mailto:swift-dev@swift.org> https://lists.swift.org/mailman/listinfo/swift-dev
Hmm - you’re right. I tried compiling the example code on master, and didn’t see a crash. I just tried again, though, and now I do.
The stack trace is new to me, but it does look related to the ArchetypeBuilder changes.
- Joe
···
On Feb 10, 2016, at 9:29 AM, Joe Groff <jgroff@apple.com> wrote:
I'm not certain that yesterday's fix would cover this case.
-Joe
On Feb 10, 2016, at 9:20 AM, Joe Pamer via swift-dev <swift-dev@swift.org <mailto:swift-dev@swift.org>> wrote:
Hi Alex,
I’m pretty sure Joe Groff pushed a fix for this yesterday (it landed in swift-2.2-branch with 9e9537 and master as c165811). I’ll double-check.
Thanks!
- Joe
On Feb 9, 2016, at 11:56 PM, Alex Hoppen via swift-dev <swift-dev@swift.org <mailto:swift-dev@swift.org>> wrote:
Hi everyone,
I just found a major regression bug in Swift 2.2 (it’s tracked under SR-706 <https://bugs.swift.org/browse/SR-706>\). Since Swift 2.2 development seems to come to an end I wanted to raise some attention for this bug by posting it here as well.
- Alex
When using the generic argument of a function as a parameter of another generic class that is used in the signature, the compiler crashes with Illegal instruction: 4
<>Example
class GenericClass<T> { }
protocol MyProtocol { }
class MyClass {
func myFunction<T, O: GenericClass<T> where T: MyProtocol>(myArg: O) -> T {
fatalError()
}
}
<>Interesting crash facts
This used to work with Swift 2.1
This works with the version of Swift that is shipped with Xcode 7.3 beta 2 (7D129n)
It crashes the Swift 2.2 and Swift 3 compiler since the snapshot of 01/11/2016 (that’s the oldest snapshot I have installed)
The code compiles fine with the current master (as of 02/10/2016, commit 073df63) iff myFunction is a global function and not a method in a class
_______________________________________________
swift-dev mailing list
swift-dev@swift.org <mailto:swift-dev@swift.org> https://lists.swift.org/mailman/listinfo/swift-dev