Skip to content

Instantly share code, notes, and snippets.

@baybatu
Last active January 14, 2016 07:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baybatu/8e527b8574be36686bc0 to your computer and use it in GitHub Desktop.
Save baybatu/8e527b8574be36686bc0 to your computer and use it in GitHub Desktop.
Groovy Generic Metod Ayıklama Hatası

Groovy'de

// derleme hatası
<T> void execute(Request<T> request) {
  // kodlar
}

tarzı bir metot imzası ayıklama hatasına(parsing error) sebep olur. Bu sorunu gidermek için generic tip bildiriminin başına keyword eklemek gerekir. public, private, protected gibi bir erişim niteliyicisi (access modifier) veya def gibi bir bildirim eklemek yeterlidir.

// doğru kod
def <T> void execute(Request<T> request) {
  // kodlar
}

Bilgi: http://stackoverflow.com/a/11395596/3871815

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment