Skip to content

Commit

Permalink
[Compiler] Tests for New version of 'match' typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladD2 committed Sep 3, 2011
1 parent 8e81f1d commit d144030
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions ncc/testsuite/negative/tyenf.n
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Nemerle.IO;
using System;
using System.Console;

class A {}
class B : A {}
Expand Down Expand Up @@ -61,4 +63,85 @@ module M1 {
else
Fruit.Apple;
}

public c2(a: int): int
{
def b()
{
if (a == 2)
(); // E: Cannot implicitly convert type 'void' to 'int\+'.
else
1
}

if (a == 1)
b()
else
1;
}

public c3(a: int): void
{
def b()
{
if (a == 2)
1 // W: ignored computed value of type int
else
();
}

if (a == 1)
b()
else
1; // W: gnored computed value of type int
}
public c1(a: int): int
{
if (a == 1)
() // E: Cannot implicitly convert type 'void' to 'int\+'
else
1;
}

public c5(a: int): int
{
if (a == 1)
1
else
() // E: Cannot implicitly convert type 'void' to 'int'
}

public c4(a: int): void
{
if (a == 1)
1 // W: ignored computed value of type int
else
()
}

public c6(a: int) : long
{
if (a == 1)
"s" // E: Cannot implicitly convert type 'string' to 'long\+'
else
1;
}

public d1() : void
{
if (Environment.ProcessorCount > 0)
ReadLine(); // W: ignored computed value of type string
else
WriteLine();

_ = ReadLine();
}

public d2() : void
{
if (Environment.ProcessorCount > 0)
WriteLine();
else
ReadLine(); // W: ignored computed value of type string
}
}

0 comments on commit d144030

Please sign in to comment.