id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	lang	patch	platform
1133	MMD matching does not match 'scalar' with primitive types	Austin_Hastings		"When MMD is matching a primitive (int, float, str) argument, it knows about autoboxing and supplies a 1-point manhattan penalty for requiring autoboxing into one of the Scalar types (Integer, Float, etc.)

But MMD does not appear to know about 'scalar' as a superclass of the Scalar types, since it is handing the autoboxing specially. 
 
As a result, this code misbehaves:
{{{
.sub 'foo' :multi(['scalar'])
	.param pmc x
	say ""Scalar!""
.end

.sub 'foo' :multi()
	.param pmc x
	$I0 = isa x, 'scalar'
	print ""Scalar? ""
	say $I0
.end

.sub 'main' :main
	'foo'(1)
	$P0 = box 1
	'foo'($P0)
.end
}}}

While `foo(1)` is ''not'' considered a scalar, `foo(box(1))` ''is,'' which is confusing. (And wrong, IMO.)
 
I suggest recoding the special-case processing for primitive types in manhattan-distance so autobox is considered a ""step"" in the MRO below 'scalar' for Scalar types.

That is, the MRO for 'Integer' would be {Integer}->scalar->integer. Alternatively, special-casing the 'scalar' PMC type as an extra builtin would work, but smells like a dead fish."	bug	closed	normal		none	1.6.0	medium	fixed					
