Compare metadata and diagnostics by identity when optizing a copy

This commit is contained in:
Jaroslav Tulach 2024-09-09 15:50:15 +02:00
parent 097cd9b134
commit 6f93f4e7fc
30 changed files with 138 additions and 138 deletions

View File

@ -72,8 +72,8 @@ object CallArgument {
name != this.name
|| value != this.value
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Specified(name, value, location, passData)

View File

@ -124,8 +124,8 @@ object DefinitionArgument {
|| defaultValue != this.defaultValue
|| suspended != this.suspended
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Specified(

View File

@ -35,8 +35,8 @@ sealed case class Empty(
): Empty = {
if (
location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Empty(location, passData)

View File

@ -90,8 +90,8 @@ object Expression {
|| returnValue != this.returnValue
|| suspended != this.suspended
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Block(
@ -231,8 +231,8 @@ object Expression {
name != this.name
|| expression != this.expression
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Binding(name, expression, location, passData)

View File

@ -118,8 +118,8 @@ object Function {
|| body != this.body
|| location != this.location
|| canBeTCO != this.canBeTCO
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res =
@ -284,8 +284,8 @@ object Function {
|| isPrivate != this.isPrivate
|| location != this.location
|| canBeTCO != this.canBeTCO
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res =

View File

@ -65,8 +65,8 @@ object Literal {
base != this.base
|| value != this.value
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Number(base, value, location, passData)
@ -197,8 +197,8 @@ object Literal {
if (
text != this.text
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Text(text, location, passData)

View File

@ -80,8 +80,8 @@ final case class Module(
|| bindings != this.bindings
|| isPrivate != this.isPrivate
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res =

View File

@ -76,8 +76,8 @@ object Name {
typePointer != this.typePointer
|| methodName != this.methodName
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res =
@ -246,8 +246,8 @@ object Name {
if (
parts != this.parts
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Qualified(parts, location, passData)
@ -317,8 +317,8 @@ object Name {
): Blank = {
if (
location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Blank(location, passData)
@ -399,8 +399,8 @@ object Name {
if (
specialName != this.specialName
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Special(specialName, location, passData)
@ -505,8 +505,8 @@ object Name {
|| isMethod != this.isMethod
|| location != this.location
|| originalName != this.originalName
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Literal(name, isMethod, location, originalName, passData)
@ -614,8 +614,8 @@ object Name {
if (
name != this.name
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = BuiltinAnnotation(name, location, passData)
@ -709,8 +709,8 @@ object Name {
name != this.name
|| expression != this.expression
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res =
@ -820,8 +820,8 @@ object Name {
if (
synthetic != this.synthetic
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Self(location, synthetic, passData)
@ -919,8 +919,8 @@ object Name {
): SelfType = {
if (
location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = SelfType(location, passData)

View File

@ -66,8 +66,8 @@ object Pattern {
if (
name != this.name
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Name(name, location, passData)
@ -169,8 +169,8 @@ object Pattern {
constructor != this.constructor
|| fields != this.fields
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Constructor(constructor, fields, location, passData)
@ -324,8 +324,8 @@ object Pattern {
if (
literal != this.literal
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Literal(literal, location, passData)
@ -429,8 +429,8 @@ object Pattern {
name != this.name
|| tpe != this.tpe
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Type(name, tpe, location, passData)
@ -549,8 +549,8 @@ object Pattern {
if (
doc != this.doc
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Documentation(doc, location, passData)

View File

@ -54,8 +54,8 @@ object Type {
args != this.args
|| result != this.result
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Function(args, result, location, passData)
@ -171,8 +171,8 @@ object Type {
|| signature != this.signature
|| comment != this.comment
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Ascription(typed, signature, comment, location, passData)
@ -286,8 +286,8 @@ object Type {
typed != this.typed
|| context != this.context
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Context(typed, context, location, passData)
@ -398,8 +398,8 @@ object Type {
typed != this.typed
|| error != this.error
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Error(typed, error, location, passData)

View File

@ -86,8 +86,8 @@ object Application {
|| arguments != this.arguments
|| hasDefaultsSuspended != this.hasDefaultsSuspended
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res =
@ -203,8 +203,8 @@ object Application {
if (
target != this.target
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Force(target, location, passData)
@ -327,8 +327,8 @@ object Application {
if (
expression != this.expression
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Typeset(expression, location, passData)
@ -430,8 +430,8 @@ object Application {
if (
items != this.items
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Sequence(items, location, passData)

View File

@ -73,8 +73,8 @@ object Case {
|| branches != this.branches
|| isNested != this.isNested
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Expr(scrutinee, branches, isNested, location, passData)
@ -200,8 +200,8 @@ object Case {
|| expression != this.expression
|| terminalBranch != this.terminalBranch
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Branch(

View File

@ -62,8 +62,8 @@ object Comment {
if (
doc != this.doc
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Documentation(doc, location, passData)

View File

@ -59,8 +59,8 @@ object Error {
): InvalidIR = {
if (
ir != this.ir
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = InvalidIR(ir, passData)

View File

@ -70,8 +70,8 @@ object Foreign {
lang != this.lang
|| code != this.code
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Definition(lang, code, location, passData)

View File

@ -72,8 +72,8 @@ object Operator {
|| operator != this.operator
|| right != this.right
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Binary(left, operator, right, location, passData)

View File

@ -67,8 +67,8 @@ object Section {
arg != this.arg
|| operator != this.operator
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Left(arg, operator, location, passData)
@ -174,8 +174,8 @@ object Section {
if (
operator != this.operator
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Sides(operator, location, passData)
@ -277,8 +277,8 @@ object Section {
operator != this.operator
|| arg != this.arg
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Right(operator, arg, location, passData)

View File

@ -55,8 +55,8 @@ sealed case class Conversion(
if (
storedIr != this.storedIr
|| reason != this.reason
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Conversion(storedIr, reason, passData)

View File

@ -62,8 +62,8 @@ sealed case class ImportExport(
if (
ir != this.ir
|| reason != this.reason
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = ImportExport(ir, reason, passData)

View File

@ -67,8 +67,8 @@ sealed case class Pattern(
if (
originalPattern != this.originalPattern
|| reason != this.reason
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Pattern(originalPattern, reason, passData)

View File

@ -62,8 +62,8 @@ object Redefined {
): SelfArg = {
if (
location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = SelfArg(location, passData)
@ -159,8 +159,8 @@ object Redefined {
targetType != this.targetType
|| sourceType != this.sourceType
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Conversion(targetType, sourceType, location, passData)
@ -289,8 +289,8 @@ object Redefined {
typeName != this.typeName
|| methodName != this.methodName
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Method(typeName, methodName, location, passData)
@ -419,8 +419,8 @@ object Redefined {
atomName != this.atomName
|| methodName != this.methodName
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = MethodClashWithAtom(
@ -542,8 +542,8 @@ object Redefined {
if (
typeName != this.typeName
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Type(typeName, location, passData)
@ -649,8 +649,8 @@ object Redefined {
if (
name != this.name
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Arg(name, location, passData)
@ -750,8 +750,8 @@ object Redefined {
): Binding = {
if (
invalidBinding != this.invalidBinding
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Binding(invalidBinding, passData)

View File

@ -71,8 +71,8 @@ sealed case class Resolution(
if (
originalName != this.originalName
|| reason != this.reason
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Resolution(originalName, reason, passData)

View File

@ -63,8 +63,8 @@ sealed case class Syntax(
if (
at != this.at
|| reason != this.reason
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Syntax(at, reason, passData)

View File

@ -75,8 +75,8 @@ object Unexpected {
): TypeSignature = {
if (
ir != this.ir
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = TypeSignature(ir, passData)

View File

@ -78,8 +78,8 @@ object Definition {
|| params != this.params
|| members != this.members
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Type(name, params, members, location, passData)
@ -206,8 +206,8 @@ object Definition {
|| annotations != this.annotations
|| isPrivate != this.isPrivate
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Data(
@ -338,8 +338,8 @@ object Definition {
|| arguments != this.arguments
|| body != this.body
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = SugaredType(

View File

@ -88,8 +88,8 @@ object Export {
|| onlyNames != this.onlyNames
|| isSynthetic != this.isSynthetic
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Module(

View File

@ -97,8 +97,8 @@ object Import {
|| hiddenNames != this.hiddenNames
|| isSynthetic != this.isSynthetic
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Module(

View File

@ -115,8 +115,8 @@ object Method {
|| isPrivate != this.isPrivate
|| isStaticWrapperForInstanceMethod != this.isStaticWrapperForInstanceMethod
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Explicit(
@ -322,8 +322,8 @@ object Method {
|| isPrivate != this.isPrivate
|| body != this.body
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Binding(
@ -490,8 +490,8 @@ object Method {
|| sourceTypeName != this.sourceTypeName
|| body != this.body
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Conversion(

View File

@ -55,8 +55,8 @@ sealed case class Polyglot(
entity != this.entity
|| rename != this.rename
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Polyglot(entity, rename, location, passData)

View File

@ -74,8 +74,8 @@ object Set {
|| memberType != this.memberType
|| value != this.value
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Member(label, memberType, value, location, passData)
@ -202,8 +202,8 @@ object Set {
left != this.left
|| right != this.right
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Subsumption(left, right, location, passData)
@ -315,8 +315,8 @@ object Set {
left != this.left
|| right != this.right
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Equality(left, right, location, passData)
@ -428,8 +428,8 @@ object Set {
left != this.left
|| right != this.right
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Concat(left, right, location, passData)
@ -535,8 +535,8 @@ object Set {
if (
operands != this.operands
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Union(operands, location, passData)
@ -642,8 +642,8 @@ object Set {
left != this.left
|| right != this.right
|| location != this.location
|| passData != this.passData
|| diagnostics != this.diagnostics
|| (passData ne this.passData)
|| (diagnostics ne this.diagnostics)
|| id != this.id
) {
val res = Intersection(left, right, location, passData)