зеркало из https://github.com/microsoft/verona.git
* Make verona testsuite directory dump passes. * Add test case for issue #651 * Extend test to cover related bug.
This commit is contained in:
Родитель
cf81a493de
Коммит
497f5fc3f2
|
@ -1,6 +1,6 @@
|
|||
# Arguments for testing verona-parser
|
||||
macro(toolinvoke ARGS local_dist testfile outputdir)
|
||||
set(${ARGS} "${local_dist}/verona/verona${CMAKE_EXECUTABLE_SUFFIX}" build ${testfile} -w -o ${outputdir}/ast)
|
||||
set(${ARGS} "${local_dist}/verona/verona${CMAKE_EXECUTABLE_SUFFIX}" build ${testfile} -w -o ${outputdir}/ast --dump_passes ${outputdir})
|
||||
endmacro()
|
||||
|
||||
# Set extension for verona tests
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
// Using reserved keyword in parameter and type parameter should result in errors.
|
||||
type Copyable[Self] = {
|
||||
copy(type: Self) : Self
|
||||
} & (Self < Copyable[Self])
|
|
@ -0,0 +1,34 @@
|
|||
Verona
|
||||
parse
|
||||
(top
|
||||
{}
|
||||
(file
|
||||
(equals
|
||||
(group
|
||||
(typealias
|
||||
{})
|
||||
(ident 8:Copyable)
|
||||
(square
|
||||
(group
|
||||
(Self))))
|
||||
(group
|
||||
(brace
|
||||
(group
|
||||
(ident 4:copy)
|
||||
(paren
|
||||
(group
|
||||
(typealias
|
||||
{})
|
||||
(colon)
|
||||
(Self)))
|
||||
(colon)
|
||||
(Self)))
|
||||
(symbol 1:&)
|
||||
(paren
|
||||
(group
|
||||
(Self)
|
||||
(symbol 1:<)
|
||||
(ident 8:Copyable)
|
||||
(square
|
||||
(group
|
||||
(Self)))))))))
|
|
@ -0,0 +1,43 @@
|
|||
Verona
|
||||
modules
|
||||
(top
|
||||
{}
|
||||
(group
|
||||
(class
|
||||
{})
|
||||
(ident 3:651)
|
||||
(brace
|
||||
(group
|
||||
(use)
|
||||
(ident 3:std)
|
||||
(doublecolon)
|
||||
(ident 7:builtin))
|
||||
(equals
|
||||
(group
|
||||
(typealias
|
||||
{})
|
||||
(ident 8:Copyable)
|
||||
(square
|
||||
(group
|
||||
(Self))))
|
||||
(group
|
||||
(brace
|
||||
(group
|
||||
(ident 4:copy)
|
||||
(paren
|
||||
(group
|
||||
(typealias
|
||||
{})
|
||||
(type
|
||||
(Self))))
|
||||
(type
|
||||
(Self))))
|
||||
(symbol 1:&)
|
||||
(paren
|
||||
(group
|
||||
(Self)
|
||||
(symbol 1:<)
|
||||
(ident 8:Copyable)
|
||||
(square
|
||||
(group
|
||||
(Self))))))))))
|
|
@ -0,0 +1,71 @@
|
|||
Verona
|
||||
structure
|
||||
(top
|
||||
{
|
||||
651 = class}
|
||||
(class
|
||||
{
|
||||
Copyable = typealias
|
||||
include 651}
|
||||
(ident 3:651)
|
||||
(typeparams)
|
||||
(inherit
|
||||
(dontcare))
|
||||
(typepred
|
||||
(type
|
||||
(typetrue)))
|
||||
(classbody
|
||||
(use
|
||||
(type
|
||||
(ident 3:std)
|
||||
(doublecolon)
|
||||
(ident 7:builtin)))
|
||||
(typealias
|
||||
{
|
||||
trait$0 = typetrait}
|
||||
(ident 8:Copyable)
|
||||
(typeparams
|
||||
(error
|
||||
(errormsg 46:Expected a type parameter or a value parameter)
|
||||
(group
|
||||
(Self))))
|
||||
(typepred
|
||||
(type
|
||||
(typetrue)))
|
||||
(type
|
||||
(typetrait
|
||||
{
|
||||
copy = function}
|
||||
(ident 7:trait$0)
|
||||
(classbody
|
||||
(function
|
||||
{}
|
||||
(explicit)
|
||||
(rhs)
|
||||
(ident 4:copy)
|
||||
(typeparams)
|
||||
(params
|
||||
(error
|
||||
(errormsg 20:Expected a parameter)
|
||||
(group
|
||||
(typealias
|
||||
{})
|
||||
(type
|
||||
(Self)))))
|
||||
(type
|
||||
(Self))
|
||||
(dontcare)
|
||||
(typepred
|
||||
(type
|
||||
(typetrue)))
|
||||
(dontcare))))
|
||||
(symbol 1:&)
|
||||
(type
|
||||
(typetuple
|
||||
(type
|
||||
(Self)
|
||||
(symbol 1:<)
|
||||
(ident 8:Copyable)
|
||||
(typeargs
|
||||
(type
|
||||
(Self)))))))))))
|
|
@ -0,0 +1,71 @@
|
|||
Verona
|
||||
structure
|
||||
(top
|
||||
{
|
||||
651 = class}
|
||||
(class
|
||||
{
|
||||
Copyable = typealias
|
||||
include 651}
|
||||
(ident 3:651)
|
||||
(typeparams)
|
||||
(inherit
|
||||
(dontcare))
|
||||
(typepred
|
||||
(type
|
||||
(typetrue)))
|
||||
(classbody
|
||||
(use
|
||||
(type
|
||||
(ident 3:std)
|
||||
(doublecolon)
|
||||
(ident 7:builtin)))
|
||||
(typealias
|
||||
{
|
||||
trait$0 = typetrait}
|
||||
(ident 8:Copyable)
|
||||
(typeparams
|
||||
(error
|
||||
(errormsg 46:Expected a type parameter or a value parameter)
|
||||
(group
|
||||
(Self))))
|
||||
(typepred
|
||||
(type
|
||||
(typetrue)))
|
||||
(type
|
||||
(typetrait
|
||||
{
|
||||
copy = function}
|
||||
(ident 7:trait$0)
|
||||
(classbody
|
||||
(function
|
||||
{}
|
||||
(explicit)
|
||||
(rhs)
|
||||
(ident 4:copy)
|
||||
(typeparams)
|
||||
(params
|
||||
(error
|
||||
(errormsg 20:Expected a parameter)
|
||||
(group
|
||||
(typealias
|
||||
{})
|
||||
(type
|
||||
(Self)))))
|
||||
(type
|
||||
(Self))
|
||||
(dontcare)
|
||||
(typepred
|
||||
(type
|
||||
(typetrue)))
|
||||
(dontcare))))
|
||||
(symbol 1:&)
|
||||
(type
|
||||
(typetuple
|
||||
(type
|
||||
(Self)
|
||||
(symbol 1:<)
|
||||
(ident 8:Copyable)
|
||||
(typeargs
|
||||
(type
|
||||
(Self)))))))))))
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1,14 @@
|
|||
Errors:
|
||||
Expected a type parameter or a value parameter
|
||||
-- 651.verona:2:15
|
||||
type Copyable[Self] = {
|
||||
~~~~
|
||||
|
||||
----------------
|
||||
Expected a parameter
|
||||
-- 651.verona:3:8
|
||||
copy(type: Self) : Self
|
||||
~~~~~~~~~~
|
||||
|
||||
Pass structure failed with 2 errors!
|
||||
|
Загрузка…
Ссылка в новой задаче