Swift 错误诊断教育性注释
关于GitHub
  • 使用要求带有 Self 或关联类型的协议

    2020-03-02

    诊断名称错误信息
    unsupported_existential_typeprotocol X can only be used as a generic constraint because it has Self or associated type requirements

  • 属性包装器的实现要求

    2020-02-28

    诊断名称错误信息
    property_wrapper_no_value_propertyproperty wrapper type X does not contain a non-static property named Y
    property_wrapper_wrong_initial_value_initX parameter type (Y) must be the same as its wrappedValue property type Z or an @autoclosure thereof
    property_wrapper_failable_initproperty wrapper initializer X cannot be failable
    property_wrapper_type_requirement_not_accessible[private/fileprivate/internal/public/open] XXX Y cannot have more restrictive access than its enclosing property wrapper type Z (which is [private/fileprivate/internal/public/open])

  • @dynamicCallable 的实现要求

    2020-01-13

    诊断名称错误信息
    invalid_dynamic_callable_type@dynamicCallable attribute requires X to have either a valid dynamicallyCall(withArguments:) method or dynamicallyCall(withKeywordArguments:) method
    missing_dynamic_callable_kwargs_method@dynamicCallable type X cannot be applied with keyword arguments; missing dynamicCall(withKeywordArguments:) method

  • 闭包类型推断

    2019-12-04

    诊断名称错误信息
    cannot_infer_closure_result_typeunable to infer [complex] closure return type; add explicit type to disambiguate

  • 名义类型(nominal type)

    2019-11-02

    诊断名称错误信息
    non_nominal_no_initializersnon-nominal type X does not support explicit initialization
    non_nominal_extensionnon-nominal type X cannot be extended
    associated_type_witness_conform_impossiblecandidate can not infer X = Y because Y is not a nominal type and so can’t conform to Z

Copyright © 2020 Apollo Zhu & Apollonyan

Powered by Hugo and the Notepadium