Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map of class problems when map.table not default initialized #15960

Open
daviditen opened this issue Jun 26, 2020 · 2 comments
Open

Map of class problems when map.table not default initialized #15960

daviditen opened this issue Jun 26, 2020 · 2 comments

Comments

@daviditen
Copy link
Member

Presently, map.table is default initialized, but it is running into issue #15929. A suggested workaround was to instead declare it as:

  var table = new chpl__hashtable(keyType, valType);

However, after changing it to the above, some cases of maps of classes fail with internal compiler errors. Failures include building mason, and test/library/standard/Map/testBorrowedMap.chpl. I attempted to tease this error apart from map, but was unsuccessful.

The errors are along the lines of:

$CHPL_HOME/modules/standard/Map.chpl:74: internal error: invalid attempt to get reference type [AST/primitive.cpp:235]
@mppf
Copy link
Member

mppf commented Jun 29, 2020

From #15929 (comment) - Here it looks like the problem is that the compiler is trying to resolve PRIM_ADDR_OF with a chpl__hashtable variable that has generic type

@daviditen daviditen self-assigned this Jun 30, 2020
@daviditen
Copy link
Member Author

I simplified a test case down to

use ChapelHashtable;

record mmap {
  type keyType;
  type valType;

  pragma "no doc"
  var table = new chpl__hashtable(keyType, valType);

  proc method() {
    for slot in table.allSlots() { }
  }
}

class C {
  var i: int;
}

var m: mmap(int, borrowed C);

m.method();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants