Index: Source/Expr.cobra
===================================================================
--- Source/Expr.cobra	(revision 1925)
+++ Source/Expr.cobra	(working copy)
@@ -661,7 +661,10 @@
 					if arg.type == param.type
 						score += 20
 					else if arg.canBeAssignedTo(param.type)
-						score += 10
+						if param.type inherits VariType   # Rational: T[] -> vari T should be preferred over T[] -> T*, 
+							score += 15					  # although both satisfy the "assignability" condition
+						else
+							score += 10
 					else if arg.type.nonNil.isAssignableTo(param.type) 
 						# Cobra's code and data flow analysis sometimes leaves us with a nilable type that's not actually nil anymore
 						# due to an assignment, possibly wrapped in an if statement. Eventually this will be corrected, but for now
Index: Source/Types.cobra
===================================================================
--- Source/Types.cobra	(revision 1925)
+++ Source/Types.cobra	(working copy)
@@ -1651,9 +1651,13 @@
 	def isAssignableTo(type as IType) as bool is override
 		if base.isAssignableTo(type)
 			return true
+		if type inherits VariType  
+			# A[] is assignable to "vari B" if A assignable to B
+			if _wrappedType.isAssignableTo(type.trueInner) 
+				return true       # TODO: wouldn't it be faster to make "return _wrappedType.isAssignableTo(type.trueInner)" ??
 		if type inherits ArrayType
 			if _wrappedType == type.theWrappedType
-				return true
+				return true       # TODO: wouldn't it be faster to make "return _wrappedType == type.theWrappedType" ??
 		if type inherits StreamType
 			return .isAssignableTo(type.box to !)
 		return false
@@ -1677,6 +1681,8 @@
 		return member
 
 
+# TODO: Why all the indirections? Vari[Nilable[Array[T]]]? 
+# Can't we just inherit Vari from Array?
 class VariType
 	is partial
 	inherits ArrayType
@@ -1696,6 +1702,17 @@
 
 	get innerType as IType? is override
 		return _wrappedType
+		
+	get trueInner as IType			
+		# TODO: this does not seem especially fast: cache it
+		inner1 = .theWrappedType
+		assert inner1.getType == NilableType
+		if inner1 inherits NilableType
+			inner2 = inner1.theWrappedType
+			assert inner2.getType == ArrayType
+			if inner2 inherits ArrayType
+				return inner2.theWrappedType
+		throw FallThroughException(this) 
 
 	def isEquatableTo(t as IType) as bool is override
 		# vari type inherits IList<of>
Index: Tests/120-classes/115-overload-stream.cobra
===================================================================
--- Tests/120-classes/115-overload-stream.cobra	(revision 0)
+++ Tests/120-classes/115-overload-stream.cobra	(revision 0)
@@ -0,0 +1,31 @@
+class X
+	
+	# this tests one aspect of the overload resolution algorithm
+	# namely, that the vari overload  is preferred 
+	# over the stream overlad when passing an array
+	# (see Expr.cobra, method _computeBestOverload)
+	
+	def foo(stream as int*) is shared
+		assert false
+ 
+	def foo(v as vari int) is shared
+		pass
+
+	# just in case, test it as well with a non-primitive
+	# type and instance methods
+	
+	def bar(stream as String*)
+		assert false
+ 
+	def bar(v as vari String)
+		pass
+
+	def main is shared
+		
+		X.foo(@[1, 2, 3])
+		X().bar(@['hi', 'there'])
+		
+		
+		
+	
+	

