899 {
900 ASSERT(!dst_name.IsNull());
902 Zone* zone = thread->zone();
904
906
907 DartFrameIterator iterator(thread,
911 zone,
script.IsNull() ? Symbols::OptimizedOut().ptr() :
script.url());
913 intptr_t column = -1;
915 script.GetTokenLocation(location, &
line, &column);
916 }
917
921
922
923 const GrowableObjectArray& pieces =
925
926 if (!dst_type.IsNull()) {
927
928 if (!src_type.IsNull()) {
929 pieces.Add(Symbols::TypeQuote());
931 pieces.Add(Symbols::QuoteIsNotASubtypeOf());
932 }
933 pieces.Add(Symbols::TypeQuote());
936 if (dst_name.Length() > 0) {
937 if (dst_name.ptr() == Symbols::InTypeCast().ptr()) {
938 pieces.Add(dst_name);
939 } else {
940 pieces.Add(Symbols::SpaceOfSpace());
942 pieces.Add(dst_name);
944 }
945 }
946
948 if (!src_type.IsNull()) {
949 src_type.EnumerateURIs(&uris);
950 }
951 if (!dst_type.IsDynamicType() && !dst_type.IsVoidType() &&
952 !dst_type.IsNeverType()) {
953 dst_type.EnumerateURIs(&uris);
954 }
955 const String& formatted_uris =
957 if (formatted_uris.Length() > 0) {
958 pieces.Add(Symbols::SpaceWhereNewLine());
959 pieces.Add(formatted_uris);
960 }
961 }
964 args.SetAt(3, error_msg);
965
966
967
968 if (FLAG_print_stacktrace_at_throw) {
969 THR_Print(
"'%s': Failed type check: line %" Pd " pos %" Pd ": ",
971 THR_Print(
"%s\n", error_msg.ToCString());
972 }
973
974
977}
static StringPtr PrintURIs(URIs *uris)
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
static ArrayPtr MakeFixedLength(const GrowableObjectArray &growable_array, bool unique=false)
static DART_NORETURN void ThrowByType(ExceptionType type, const Array &arguments)
static ScriptPtr GetCallerScript(DartFrameIterator *iterator)
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
virtual const char * ToCString() const
static SmiPtr New(intptr_t value)
@ kNoCrossThreadIteration
static StringPtr ConcatAll(const Array &strings, Heap::Space space=Heap::kNew)
static const String & SingleQuote()
static Thread * Current()
#define THR_Print(format,...)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
ZoneGrowableHandlePtrArray< const String > URIs