@@ -543,15 +543,17 @@
|| lhs->interface_type() != NULL))
return true;
- // An untyped constant may be assigned to a numeric type if it is
- // representable in that type.
- if (rhs->is_abstract()
+ // An untyped numeric constant may be assigned to a numeric type if
+ // it is representable in that type.
+ if ((rhs->is_abstract()
+ && (rhs->integer_type() != NULL
+ || rhs->float_type() != NULL
+ || rhs->complex_type() != NULL))
&& (lhs->integer_type() != NULL
|| lhs->float_type() != NULL
|| lhs->complex_type() != NULL))
return true;
-
// Give some better error messages.
if (reason != NULL && reason->empty())
{