Skip to content

Commit

Permalink
[docs] Add FAQ entry for explaining '<>' syntax.
Browse files Browse the repository at this point in the history
close #488

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Sep 15, 2016
1 parent 38396cc commit 079f719
Showing 1 changed file with 25 additions and 0 deletions.
Expand Up @@ -162,6 +162,31 @@ describe "SARL Syntax FAQ" {
)
}

/* In SARL, the empty generic parameter list, written <code>&lt,&gt;</code> is
* not supported: a generic type expression must be written between them.
*
* <p>For solving this problem, two choices: i) add a type expression between
* <code>&lt;</code> and <code>&gt;</code>; ii) remove the generic parameter
* list.
*
* <pre><code>
* var firstSolution : List<Integer> = new ArrayList<Integer>()
* var secondSolution : List<Integer> = new ArrayList()
* </code></pre>
*
* @filter(.*)
*/
fact "Why can I not use the '&lt;&gt;' notation for generic parameters?" {
'''
package io.sarl.docs.faq.syntax
import java.util.List
import java.util.ArrayList
agent A {
var a : List<Integer> = new ArrayList<>()
}
'''.parseWithError
}

}

}

0 comments on commit 079f719

Please sign in to comment.