Skip to content

Commit 9880192

Browse files
committed
---
yaml --- r: 2203 b: refs/heads/master c: 14d1c53 h: refs/heads/master i: 2201: 26a8a5e 2199: dafdd64 v: v3
1 parent d7e16c7 commit 9880192

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
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: c7473c8260cbe6892eeed82f275bf09a73895e0e
2+
refs/heads/master: 14d1c53a9c3570f91ede7d7ad9c8c1ad9ddef7f3

trunk/src/comp/middle/ty.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ fn mk_native(@type_store ts) -> t { ret gen_ty(ts, ty_native); }
217217
// Returns the one-level-deep type structure of the given type.
218218
fn struct(t typ) -> sty { ret typ.struct; }
219219

220+
// Returns the canonical name of the given type.
221+
fn cname(t typ) -> option.t[str] { ret typ.cname; }
222+
220223

221224
// Stringification
222225

@@ -346,7 +349,7 @@ fn ty_to_str(&t typ) -> str {
346349
}
347350

348351
case (ty_obj(?meths)) {
349-
alt (typ.cname) {
352+
alt (cname(typ)) {
350353
case (some[str](?cs)) {
351354
s += cs;
352355
}
@@ -1214,15 +1217,15 @@ fn eq_ty_full(&t a, &t b) -> bool {
12141217
}
12151218

12161219
// Check canonical names.
1217-
alt (a.cname) {
1220+
alt (cname(a)) {
12181221
case (none[str]) {
1219-
alt (b.cname) {
1222+
alt (cname(b)) {
12201223
case (none[str]) { /* ok */ }
12211224
case (_) { ret false; }
12221225
}
12231226
}
12241227
case (some[str](?s_a)) {
1225-
alt (b.cname) {
1228+
alt (cname(b)) {
12261229
case (some[str](?s_b)) {
12271230
if (!_str.eq(s_a, s_b)) { ret false; }
12281231
}

0 commit comments

Comments
 (0)