@@ -2,7 +2,7 @@ import * as postcss from 'postcss';
2
2
import * as propParser from 'css-property-parser' ;
3
3
import { MultiMap , TwoKeyMultiMap } from "@opticss/util" ;
4
4
import { Style } from './Block' ;
5
- import { BLOCK_PROP_NAMES , RESOLVE_RE , SELF_SELECTOR } from "../blockSyntax " ;
5
+ import { BLOCK_PROP_NAMES , RESOLVE_RE , SELF_SELECTOR , BlockPath } from "../BlockSyntax " ;
6
6
import * as errors from '../errors' ;
7
7
import { sourceLocation } from "../SourceLocation" ;
8
8
@@ -110,11 +110,20 @@ export class RulesetContainer {
110
110
// If this is a resolution, track that this property has been resolved
111
111
if ( referenceStr ) {
112
112
113
+ let blockPath = new BlockPath ( referenceStr ) ;
113
114
let other = style . block . lookup ( referenceStr ) ;
115
+ let otherBlock = style . block . getReferencedBlock ( blockPath . block ) ;
116
+
117
+ if ( ! otherBlock ) {
118
+ throw new errors . InvalidBlockSyntax (
119
+ `No Block named "${ blockPath . block } " found in scope.` ,
120
+ sourceLocation ( file , decl )
121
+ ) ;
122
+ }
114
123
115
124
if ( ! other ) {
116
125
throw new errors . InvalidBlockSyntax (
117
- `Cannot resolve Style at Block path "${ referenceStr } ".` ,
126
+ `No Style " ${ blockPath . path } " found on Block "${ otherBlock . name } ".` ,
118
127
sourceLocation ( file , decl )
119
128
) ;
120
129
}
0 commit comments