gsdlab/clafer — Issue #9: [compiler] Name resolution error prints too much raw IR
Author: mantkiew
Created: 2011-12-17 01:22:53+00:00
State: open

Version: 0.0.3

Strange name resolution behavior and inappropriate error reporting. Two cases:

1) No error reported if the entire model is
D.cfr
-------
```clafer
abstract A
b ?
[ B ]
```clafer

Clearly B is undefined, and yet:

>clafer3 -k D.cfr

Parse Successful!
[Desugaring]
[Resolving]
[Analyzing String]
[Optimizing]
[Generating Code]
All clafers: 2 | Abstract: 1 | Concrete: 1 | References: 0
Constraints: 1
Global scope: 1..*
All names unique: True

[Saving File]

2) However, when adding an instance a1 : A as follows

D.cfr
-------
```clafer
abstract A
b ?
[ B ]

a1 : A
```clafer

>clafer3 -k D.cfr

Parse Successful!
[Desugaring]
[Resolving]
[Analyzing String]
[Optimizing]
[Generating Code]
All clafers: 3 | Abstract: 1 | Concrete: 2 | References: 0
Constraints: 1
Global scope: 1..*
All names unique: False

[Saving File]
clafer3: B not found within Just "A"SEnv {clafers = [IClafer {isAbstract = True, gcard = Just (IGCar
, interval = (0,ExIntegerAst)}), ident = "A", uid = "c1_A", super = ISuper {isOverlapping = False, s
= Just ISet, pid = "", exp = IClaferId {modName = "", sident = "clafer", isTop = True}}]}, card = J
, glCard = (0,ExIntegerAst), elements = [IEClafer (IClafer {isAbstract = False, gcard = Just (IGCard
interval = (0,ExIntegerAst)}), ident = "b", uid = "c2_b", super = ISuper {isOverlapping = False, su
= Just ISet, pid = "", exp = IClaferId {modName = "", sident = "clafer", isTop = True}}]}, card = Ju
...

and it continues printing a lot. For large models, it takes very long time to print (it never stopped for me). That is very annoying behavior.