[svn] r7817: nemerle/trunk: ncc/testsuite/positive/overloading.n
ncc/typing/Typer.n tools/nemerlish/eval.n
divan
svnadmin at nemerle.org
Sat Oct 20 17:34:39 CEST 2007
Log:
Fix 1054.
Author: divan
Date: Sat Oct 20 17:34:36 2007
New Revision: 7817
Modified:
nemerle/trunk/ncc/testsuite/positive/overloading.n
nemerle/trunk/ncc/typing/Typer.n
nemerle/trunk/tools/nemerlish/eval.n
Modified: nemerle/trunk/ncc/testsuite/positive/overloading.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/overloading.n (original)
+++ nemerle/trunk/ncc/testsuite/positive/overloading.n Sat Oct 20 17:34:36 2007
@@ -1,4 +1,5 @@
using Nemerle.IO;
+using Bug1054;
class A {}
class B : A {}
class C : B { public this () {} }
@@ -104,6 +105,12 @@
}
}
+class Bug1054
+{
+ public static Last[T] (this _ : list[T]) : list[string] {
+ ["hello"]
+ }
+}
module M {
foo (_ : array [string]) : void { }
@@ -146,6 +153,7 @@
_ = Bug743("", "");
_ = Bug743x("");
_ = Bug743x("", "");
+ System.Console.WriteLine ([(1, 2)].Last [0]); //Bug1054
}
public Main (_args : string) : void // W: has the wrong signature to be an entry point
@@ -164,5 +172,6 @@
743.object
743x.string
743x.string
+1
END-OUTPUT
*/
Modified: nemerle/trunk/ncc/typing/Typer.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer.n (original)
+++ nemerle/trunk/ncc/typing/Typer.n Sat Oct 20 17:34:36 2007
@@ -2224,7 +2224,11 @@
match (obj) {
| TExpr.PropertyMember (_, prop) when prop.IsIndexer
| TExpr.StaticPropertyRef (_, prop) when prop.IsIndexer
- | TExpr.Delayed (DelayedTyping where (DtKind = Overloaded)) =>
+ | TExpr.Delayed (DelayedTyping where (DtKind = Overloaded (lst))) when
+ List.Exists (lst, op => match (op.Member) {
+ | p is IProperty => p.IsIndexer
+ | _ => false
+ }) =>
Some (TypeCall (<[ $(obj : typed) ]>, args, expected, is_property = true))
| _ =>
Modified: nemerle/trunk/tools/nemerlish/eval.n
==============================================================================
--- nemerle/trunk/tools/nemerlish/eval.n (original)
+++ nemerle/trunk/tools/nemerlish/eval.n Sat Oct 20 17:34:36 2007
@@ -84,7 +84,7 @@
def eval = Evaluator (false, null);
match (eval.Eval (code)) {
| [] => null
- | returned => (returned.Last:_) [3]; //remove :_ when bug1054 is resolved
+ | returned => returned.Last [3];
}
}
More information about the svn
mailing list