当前位置: 首页 > news >正文

网站免费在线观看阿里巴巴网站图片怎么做的

网站免费在线观看,阿里巴巴网站图片怎么做的,商户 wordpress,网站制作与网站建设pdf一、概述 Kotlin 2.0.20英文版官方文档 Kotlin 2.0.20发布了!这个版本包括对Kotlin 2.0.0的性能改进和bug修复#xff0c;我们在其中宣布Kotlin K2编译器为Stable。以下是本次发布的一些亮点: 数据类复制函数将具有与构造函数相同的可见性来自默认目标层次结构的源集的静态访…一、概述 Kotlin 2.0.20英文版官方文档 Kotlin 2.0.20发布了!这个版本包括对Kotlin 2.0.0的性能改进和bug修复我们在其中宣布Kotlin K2编译器为Stable。以下是本次发布的一些亮点: 数据类复制函数将具有与构造函数相同的可见性来自默认目标层次结构的源集的静态访问器现在可以在多平台项目中使用Kotlin/Native的并发标记已经在垃圾收集器中成为可能Kotlin/Wasm中的ExperimentalWasmDsl注释有一个新位置Gradle 8.6-8.8版本增加了支持一个新的选项允许在Gradle项目之间以类文件的形式共享JVM工件撰写编译器已更新对uuid的支持已添加到公共Kotlin标准库中 二、数据类复制函数与构造函数具有相同的可见性 Kotlin 2.0.20开始引入更改以提高数据类的一致性并替换实验性上下文接收器特性。 目前如果使用私有构造函数创建数据类则自动生成的copy()函数不具有相同的可见性。这可能会在稍后的代码中导致问题。在未来的Kotlin版本中我们将引入copy()函数的默认可见性与构造函数相同的行为。此更改将逐步引入以帮助您尽可能顺利地迁移代码。 我们的迁移计划从Kotlin 2.0.20开始它会在代码中发出警告将来可见性会发生变化。例如: // Triggers a warning in 2.0.20 data class PositiveInteger private constructor(val number: Int) {companion object {fun create(number: Int): PositiveInteger? if (number 0) PositiveInteger(number) else null} }/*** 数据类复制函数与构造函数具有相同的可见性* * ConsistentCopyVisibility 用于标记一个类或接口以表明其副本在可见性方面应该是一致的。换句话说当你创建一个类的副本时副本的可见性应该与原始类实例的可见性相匹配。*/ fun testConsistentCopyVisibility(){val positiveNumber PositiveInteger.create(42) ?: return// Triggers a warning in 2.0.20val negativeNumber positiveNumber.copy(number -1)// Warning: Non-public primary constructor is exposed via the generated copy() method of the data class.// The generated copy() will change its visibility in future releases. }fun main() {testConsistentCopyVisibility() }运行结果 报错信息 Non-public primary constructor is exposed via the generated copy() method of the data class.The generated copy() will change its visibility in future releases.To suppress the warning do one of the following: - Annotate the data class with the ConsistentCopyVisibility annotation. - Use the -Xconsistent-data-class-copy-visibility compiler flag. - Annotate the data class with the ExposedCopyVisibility annotation (Discouraged, but can be used to keep binary compatibility).To learn more, see the documentation of the ConsistentCopyVisibility and ExposedCopyVisibility annotations. 为了对这种行为有更多的控制在Kotlin 2.0.20中我们引入了两个注释: ConsistentCopyVisibility现在就可以选择加入该行为否则我们会在以后的版本中将其设为默认值。ExposedCopyVisibility选择退出该行为并在声明站点上抑制警告。注意即使有了这个注释当调用copy()函数时编译器仍然会报告警告。 如果您想为整个模块而不是单个类选择2.0.20中已经有的新行为您可以使用-Xconsistent-data-class-copy-visibility编译器选项。该选项与在模块中的所有数据类中添加ConsistentCopyVisibility注释具有相同的效果。 三、标准库 标准库现在支持通用唯一标识符作为实验特性并包括对Base64解码的一些更改。 3.1 在通用Kotlin标准库中支持uuid 本特性是实验性的。要选择加入请使用ExperimentalUuidApi注释或编译器选项-opt-inkotlin.uuid.ExperimentalUuidApi。 Kotlin 2.0.20引入了一个类来表示通用Kotlin标准库中的uuid(通用唯一标识符)以解决唯一标识项的问题。 此外该特性还为以下uuid相关操作提供了api: 生成uuid。解析uid并将其格式化为字符串表示形式。从指定的128位值创建uuid。访问UUID的128位。 下面的代码示例演示了这些操作: OptIn(ExperimentalUuidApi::class) fun testUUIDs(){val byteArray byteArrayOf(0x55, 0x0E, 0x84.toByte(), 0x00, 0xE2.toByte(), 0x9B.toByte(), 0x41, 0xD4.toByte(),0xA7.toByte(), 0x16, 0x44, 0x66, 0x55, 0x44, 0x00, 0x00)val uuid1 Uuid.fromByteArray(byteArray)val uuid2 Uuid.fromULongs(0x550E8400E29B41D4uL, 0xA716446655440000uL)val uuid3 Uuid.parse(550e8400-e29b-41d4-a716-446655440000)println(uuid1) // 550e8400-e29b-41d4-a716-446655440000println(uuid1 uuid2) // trueprintln(uuid2 uuid3) // true// Accesses UUID bitsval version uuid1.toLongs { mostSignificantBits, _ -((mostSignificantBits shr 12) and 0xF).toInt()}println(version) // 4// Generates a random UUIDval randomUuid Uuid.random()println(uuid1 randomUuid) // false }fun main() { // testConsistentCopyVisibility()testUUIDs() }运行结果 四、kt_2020.kt文件代码 package com.example.test.ktversionimport kotlin.uuid.ExperimentalUuidApi import kotlin.uuid.Uuid//https://kotlinlang.org/docs/whatsnew2020.html // Triggers a warning in 2.0.20// 数据类复制函数与构造函数具有相同的可见性 ConsistentCopyVisibility //data class PositiveInteger private constructor(val number: Int) { //报错信息Cannot access fun copy(number: Int ...): PositiveInteger: it is private in data class PositiveInteger constructor(val number: Int) {companion object {fun create(number: Int): PositiveInteger? if (number 0) PositiveInteger(number) else null} }/*** 数据类复制函数与构造函数具有相同的可见性** ConsistentCopyVisibility 用于标记一个类或接口以表明其副本在可见性方面应该是一致的。换句话说当你创建一个类的副本时副本的可见性应该与原始类实例的可见性相匹配。*/ fun testConsistentCopyVisibility(){val positiveNumber PositiveInteger.create(42) ?: return// Triggers a warning in 2.0.20val negativeNumber positiveNumber.copy(number -1)// Warning: Non-public primary constructor is exposed via the generated copy() method of the data class.// The generated copy() will change its visibility in future releases. }// https://kotlinlang.org/docs/whatsnew2020.html#standard-library // 通用的标准库支持 UUIDs // Constructs a byte array for UUID creation OptIn(ExperimentalUuidApi::class) fun testUUIDs(){val byteArray byteArrayOf(0x55, 0x0E, 0x84.toByte(), 0x00, 0xE2.toByte(), 0x9B.toByte(), 0x41, 0xD4.toByte(),0xA7.toByte(), 0x16, 0x44, 0x66, 0x55, 0x44, 0x00, 0x00)val uuid1 Uuid.fromByteArray(byteArray)val uuid2 Uuid.fromULongs(0x550E8400E29B41D4uL, 0xA716446655440000uL)val uuid3 Uuid.parse(550e8400-e29b-41d4-a716-446655440000)println(uuid1) // 550e8400-e29b-41d4-a716-446655440000println(uuid1 uuid2) // trueprintln(uuid2 uuid3) // true// Accesses UUID bitsval version uuid1.toLongs { mostSignificantBits, _ -((mostSignificantBits shr 12) and 0xF).toInt()}println(version) // 4// Generates a random UUIDval randomUuid Uuid.random()println(uuid1 randomUuid) // false } fun main() {testConsistentCopyVisibility()testUUIDs() }
http://www.hkea.cn/news/14509895/

相关文章:

  • 哈尔滨网站建设丿薇山西省财政厅门户网站三基建设
  • 网页设计与网站建设中的热点滕州网站建设制作
  • 奉贤做网站建设网站登陆口提交网站
  • 天津网站营销seo电话收费底的网站有吗
  • 企业网站内容如何搭建长岛网站建设
  • 网站业务怎么做关于解决网站 建设的请示
  • 智能logo设计网站wordpress生成
  • 网站后台添加图片链接公司部门部长是什么级别
  • 满城做网站电话动态倒计时网站模板
  • 商业网站在规划与设计时应着重考虑哪些因素宁波网站建设的过程
  • 如何向搜索引擎提交网站报考二级建造师证需要什么条件
  • 十堰网站建设u2028wordpress数字商城
  • wordpress电影站找私人做网站
  • 肇庆网站建设方案维护百度电脑版下载官网
  • 铁岭做网站包括哪些太原做网站需要多少钱
  • 自己做的网站会被黑吗wordpress婚庆主题
  • 网站备案管理系统一般网站建设需求有哪些
  • 天津网站建设 阿土伯5个不好的网站
  • 什么样的网站利于百度优化怎么在网上卖东西视频
  • 做哪些网站不受法律保护网页版游戏排行榜田田田田田田田田
  • 域名转出过程网站能打开吗2023年8月新闻热点事件
  • 360建站公司苏州 网站建设 app
  • 公司请人做的网站 域名属于谁网站建设公司郴州
  • .la域名做的网站行业数据可以从哪里获取
  • 如何架设php网站杭州企业推广网站
  • 北京专业建设网站价格网站建设咨询加工
  • 咸阳市城乡建设规划局网站免费的微网站哪个好
  • 网站建设公司问答营销案例电子商务网站建设及维护管理
  • 番禺做网站价格长春网站建设哪家好
  • 多用户商城网站建设二次开发临沂画册设计公司