[swift-dev] Swift 2.2 regression bug: Using generic parameter as a generic argument in the same clause

Joe Groff jgroff at apple.com
Wed Feb 10 11:29:59 CST 2016


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 at 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 at swift.org <mailto:swift-dev at 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 at swift.org <mailto:swift-dev at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-dev
> 
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160210/622011fd/attachment.html>


More information about the swift-dev mailing list