-
Notifications
You must be signed in to change notification settings - Fork 17
Changing revision date of module in certain way causes odd compile error on uses reference, even stranger way of changing it back removes compile error #63
Description
I'm seeing a very odd sequence of events working with a simple module. See more information past the code block. I'm using the following:
/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
module bar {
yang-version 1;
namespace "urn:yang:bar";
prefix "bar";
import baz {
prefix "baz";
}
revision "2014-03-21" { // Test: change "21" to "22"
}
grouping machine-def {
}
grouping stuff {
uses machine-def; // Causes compile error on this line: Grouping 'machine-def' not found
}
container factory {
container alpha {
uses baz:machine-def;
}
container beta {
uses baz:machine-def;
}
}
rpc create-factory {
input {
uses baz:machine-def;
}
}
rpc create-nested-factory {
input {
container nested {
uses baz:machine-def;
}
}
}
grouping machine-types {
container types {
choice machine-type {
}
}
}
grouping machine-ext {
uses machine-types {
augment "types/machine-type" {
case type-a {
leaf id {
type string;
}
}
}
}
}
}
I put my cursor just past the date value on the "revision" statement, sitting on the ending double quote. I then pressed Backspace to remove the "1", and then pressed "2". At that point, a red marker appeared on the annotated "uses" statement a few lines down, saying that the grouping referenced on this line, which is defined just before this, now doesn't exist ("Grouping 'machine-def' not found").
I then reverted my change by pressing backspace again and entering "1", then adding an additional space after the "21", and then deleting the space I just entered. I then saved the buffer. At that point, the red marker went away. This last sequence seems very contrived, but I actually tried several other ways to revert the change, and most of them didn't remove the red marker.
I was also able to do variations which left the "22", but removed the red marker. This always included the step of adding the extra space, and then removing it.