Error when using Generic as property type in Swift

前端 未结 3 1322
清歌不尽
清歌不尽 2021-01-05 17:46

I\'m having an issue when using a Generic as the type constraint on a property. Here is a very simple example:

import UIKit

class TSSignal

        
3条回答
  •  北海茫月
    2021-01-05 18:38

    EDIT EDIT:

    This is definitely a bug in the compiler.

    I tried to 'outsmart' the compiler by using the following:

    class TSSignal
    {
        var messageType : Optional = nil
    
        init() { }
    }
    

    Same issue.

提交回复
热议问题