Skip to content

Commit 6a35002

Browse files
committed
---
yaml --- r: 3314 b: refs/heads/master c: 54566e9 h: refs/heads/master v: v3
1 parent 6727f8f commit 6a35002

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: d9f452a2a80d02c73087346872f3967f3f2a1847
2+
refs/heads/master: 54566e903781740cd1aa9f775a86db76a0fa5de7

trunk/src/comp/middle/typeck.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,11 +1994,10 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
19941994
write::ty_only_fixup(fcx, id, t);
19951995
}
19961996
case (_) {
1997-
fcx.ccx.tcx.sess.span_unimpl(expr.span,
1998-
"base type for expr_field \
1999-
in typeck::check_expr: "
2000-
+ ty_to_str(fcx.ccx.tcx,
2001-
base_t));
1997+
auto t_err = resolve_type_vars_if_possible(fcx, base_t);
1998+
auto msg = #fmt("attempted field access on type %s",
1999+
ty_to_str(fcx.ccx.tcx, t_err));
2000+
fcx.ccx.tcx.sess.span_fatal(expr.span, msg);
20022001
}
20032002
}
20042003
}

trunk/src/test/compile-fail/direct-obj-fn-call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: base type for expr_field
1+
// error-pattern: attempted field access
22

33
obj x() {
44
fn hello() {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// xfail-stage0
2+
// error-pattern:attempted field access on type vec\[int\]
3+
// issue #367
4+
5+
fn f() {
6+
auto v = [1];
7+
log v.some_field_name; //type error
8+
}
9+
10+
fn main() {}

0 commit comments

Comments
 (0)