Skip to content

define a alias of annotation #18802

Open
Open
@cjdxhjj

Description

@cjdxhjj

Compiler version

If you're not sure what version you're using, run print scalaVersion from sbt
(if you're running scalac manually, use scalac -version instead).
3.3.1

Minimized code

package com.nxin.product.domain

import org.axonframework.modelling.command.TargetAggregateIdentifier
import scala.annotation.meta.getter

type JLong = java.lang.Long
type JList[T] = java.util.List[T]
type JInt = java.lang.Integer
type JBool = java.lang.Boolean
type JMap[K, V] = java.util.Map[K, V]

type aggregateId = TargetAggregateIdentifier @getter

Output

[Error] C:/Users/petzold/IdeaProjects/product-center/product-center-domain/src/main/scala/com/nxin/product/domain/PreDef.scala:12:20: Cyclic reference involving val
[Error] C:/Users/petzold/IdeaProjects/product-center/product-center-domain/src/main/scala/com/nxin/product/domain/PreDef.scala:3:12: value axonframework is not a member of com.nxin.product.domain.org

// TODO add output here

Expectation

then i change my code to

package com.nxin.product.domain

import scala.annotation.meta.getter

type JLong = java.lang.Long
type JList[T] = java.util.List[T]
type JInt = java.lang.Integer
type JBool = java.lang.Boolean
type JMap[K, V] = java.util.Map[K, V]

type aggregateId = org.axonframework.modelling.command.TargetAggregateIdentifier @getter

and use it
image

it report another error
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions