interface

Installation
SKILL.md

仓颉语言接口 Skill

1. 接口定义

1.1 基本语法

  • interface I { ... } — 定义抽象类型,不包含数据,定义类型的行为
  • 成员可包含:成员函数、操作符重载函数、成员属性(prop)
  • 成员隐式 public(不允许额外访问修饰符)。实现者须使用 public
  • interface 隐式 open(open 修饰符可选)

1.2 接口定义与实现示例

interface Flyable {
    func fly(): Unit
}
Installs
5
First Seen
Mar 11, 2026
interface — kong-baiming/cangjie-doc-skills