forked from rsdn/nemerle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Compiler] Improve match typing (issue rsdn#92).
- Loading branch information
Showing
3 changed files
with
100 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// REFERENCE: System.Data | ||
|
||
using System.Data.SqlTypes; | ||
using System.Data; | ||
|
||
public class P | ||
{ | ||
public readonly static IDataReader _dataReader = null; | ||
|
||
public static SqlString GetSqlString(int index) | ||
{ | ||
// SqlString and string have a common subtype - IComparable. But we need must to use | ||
// implicite convertion instead, as their common supertype is not compatible with the type of return value. | ||
return _dataReader.IsDBNull(index) | ||
? SqlString.Null // type is SqlString | ||
: _dataReader.GetString(index); // type is string | ||
} | ||
|
||
static void Main() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters